LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   perl system/exec call, error code is needed. (https://www.linuxquestions.org/questions/linux-newbie-8/perl-system-exec-call-error-code-is-needed-898778/)

PoleStar 08-22-2011 10:15 AM

perl system/exec call, error code is needed.
 
Hi,

I want to do some thing like this

Code:

system("ssh user@host.work.com 'ls /tmp/' ");
I want to get error code back.

Also I understand system command is better option for me since exec quits right after it executes.

Thanks

AwesomeMachine 08-22-2011 10:24 AM

system("ssh user@host.work.com 'ls /tmp/' &2> 0");

should print errors to the console.

chrism01 08-22-2011 07:02 PM

See this page http://perldoc.perl.org/functions/system.html


All times are GMT -5. The time now is 05:51 AM.