Skip to content

Instantly share code, notes, and snippets.

@tylerpeterson
Created June 8, 2014 00:04
Show Gist options
  • Save tylerpeterson/82b892b1f751dd28cc30 to your computer and use it in GitHub Desktop.
Save tylerpeterson/82b892b1f751dd28cc30 to your computer and use it in GitHub Desktop.
A couple of files to help explore error-swallowing in bash pipelines.
#!/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]}
#!/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