in reply to Re: best practices for checking system return values for piped commands?
in thread best practices for checking system return values for piped commands?
my %cmds = ( 'bash' => '/usr/local/bin/bash',
'gzip' => '/usr/bin/gzip',
'lzop' => '/usr/bin/lzop',
'wc' => '/usr/bin/wc' );
my @zip_results = `$cmds{'bash'} -c '$cmds{$compress} -dc $file | $cmds{'wc'} -c ; echo \${PIPESTATUS\@}'`;
The last line of @zip_results has the status of both the 'compress' command and the 'wc' command.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: best practices for checking system return values for piped commands?
by Anonymous Monk on Apr 08, 2009 at 07:33 UTC |