suman583 has asked for the wisdom of the Perl Monks concerning the following question:
I want to capture both STDERR and STDOUT for my command execution. I am using Bourne shell and having the below below peace of code in my perl file.
$result = `$command 2>&1`;
I get only STDOUT in $result. $result is empty when there is a error.
Can someone please help on this?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unable to redirect stderr to stdout
by Athanasius (Archbishop) on Jul 03, 2014 at 06:56 UTC | |
Re: Unable to redirect stderr to stdout
by zentara (Archbishop) on Jul 03, 2014 at 08:46 UTC | |
Re: Unable to redirect stderr to stdout
by Corion (Patriarch) on Jul 03, 2014 at 07:00 UTC | |
Re: Unable to redirect stderr to stdout
by pvaldes (Chaplain) on Jul 03, 2014 at 09:53 UTC |
Back to
Seekers of Perl Wisdom