...

View Full Version : return value of a system call?



Alberto
07-06-2002, 05:28 AM
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

Alberto
07-06-2002, 06:49 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum