Created
January 14, 2012 14:13
-
-
Save mgpld/1611618 to your computer and use it in GitHub Desktop.
Detecting failure in piped commands (bash)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By default the failure is note detected: | |
set -o | grep pipefail | |
pipefail off | |
No manual entry for fear | |
echo $? | |
0 | |
# Detecting the failure | |
set -o pipefail | |
man fear | tee | |
No manual entry for fear | |
echo $? | |
16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment