Last active
January 29, 2020 15:21
-
-
Save irozgar/bf82e33c4ece0f77e0266e5c6b45f0d8 to your computer and use it in GitHub Desktop.
notes about 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
#!/usr/bin/env bash | |
# set -exo pipefail | |
set -ex | |
echo running false | |
# grep fails, but since it's piped and pipefail is not enabled the result of the full | |
# command exists with zero (sort is the last command executed) if we enable pipefail | |
# this will fail, so teh script will exit with error code 1 because of -e | |
grep test nonexistentfile | sort | |
echo running true | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment