|
|
| "be consistent" | |
| PerlMonks |
Re: best practices for checking system return values for piped commands?by Hue-Bond (Priest) |
| on May 01, 2006 at 20:17 UTC ( #546754=note: print w/ replies, xml ) | Need Help?? |
|
The error checking doesn't work correctly on the last one ("boom|true"), so it fails. I believe this happens because although boom fails, something is sent through the pipe, and 'true' succeeds on the other end of the pipe. On a Linux 2.6, with a bash shell:
This is because, according to the documentation of my shell, The return status of a pipeline is the exit status of the last command, unless the pipefail option is enabled. So, if your shell works like bash in this respect, your tests are returning the results they should. --
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||