Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    return value of a system call?

    Is it possible to save the return value of system call to a variable.

    I'm using system to call another script, written by someone else if python, that returns a variable that I need.

    I know how to sent the STDOUT to null but I want to retain it for use inside my script. Is this possible? Thanks

  • #2
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well just wanted to respond that I found that answer to my question

    You can use backquotes to Invoke System Commands

    for example: $myname = `whoami`;

    be aware the you will almost always have to chop that variable after doing this because of the newlines appended to the output of normal system calls.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •