Created
June 8, 2014 00:04
-
-
Save tylerpeterson/82b892b1f751dd28cc30 to your computer and use it in GitHub Desktop.
A couple of files to help explore error-swallowing in bash pipelines.
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
#!/usr/bin/env bash -eux -o pipefail | |
#set -eux | |
indent() { | |
echo "status? $?" | |
sed -e 's/^/ /' | |
} | |
#[ -f "./deploy" ] && ( set -o pipefail; ./deploy | indent ) && exit 0 | |
#[ -f "./deploy" ] && ./deploy | indent && echo pipeline status $PIPESTATUS && exit 0 | |
[ -f "./deploy" ] && ./deploy | indent && exit ${PIPESTATUS[0]} | |
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
#!/usr/bin/env bash | |
echo failing soon | |
exit 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment