Hi,
I am executing a diff
command in perl
.
my @lines = `/usr/local/bin/diff -udr \"$expected_file\" \"$gen_file\"`;
if ($? != 0)
{
print ERRFILE "Diff between $expected_file and $gen_file failed\n";
return $diff_err;
}
Here the diff
might have failed because of some reason. For example: the stderr showed that /usr/local/bin/diff: test.txt: No such file or directory. I want to read this message in the program. How I can find the stderr message of the diff
command (or grep
or any command I execute)?
Appreciate the help in advance.
Thanks, Mathew Liju