In the following command which I execute in a Perl script, how do I capture stderr?
my $output = `ssh login.com git clone --bare [email protected]:/nfs/repo/ /nfs/repo//4124/`;
if ($? ne '0')
{
$stderr = $output;
print $stderr;
}
else
{
$stdout = $output;
print $stdout;
}
You can use Capture::Tiny to capture stdout, stderr or both merged.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With