Go Back   CodingForums.com > :: Server side development > Perl/ CGI

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-06-2002, 04:28 AM   PM User | #1
Alberto
New to the CF scene

 
Join Date: Jul 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Alberto is an unknown quantity at this point
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
Alberto is offline   Reply With Quote
Old 07-06-2002, 05:49 AM   PM User | #2
Alberto
New to the CF scene

 
Join Date: Jul 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Alberto is an unknown quantity at this point
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.
Alberto is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:09 PM.


Advertisement
Log in to turn off these ads.