http://qs321.pair.com?node_id=185695

jfw2112 has asked for the wisdom of the Perl Monks concerning the following question:

I'm using the module Net::Telnet and running system commands on a remote host? When a system command doesn't work, I don't see any of the shell error messages. Where do these shell error messages go and how do I capture them? John....

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How do I capture shell error messages from a remote host?
by kiseok7 (Beadle) on Jul 31, 2002 at 17:13 UTC
    just a way :

    capture STDERR to file and `cat the file`

    $stdout = $t->cmd("some_cmd 2> /tmp/error.tmp"); $stderr = $t->cmd("cat /tmp/error.tmp; rm /tmp/error.tmp");
    i can't sure it is good answer =(

    good luck!
Re: How do I capture shell error messages from a remote host?
by jfw2112 (Initiate) on Aug 03, 2002 at 01:26 UTC
    Thanks kiseok7. Your suggestion pointed me in the right direction. John...