Skip to content

Instantly share code, notes, and snippets.

@sudmed
Created February 4, 2023 19:47
Show Gist options
  • Save sudmed/d3d021349e765c7e4c15a39033ae87d1 to your computer and use it in GitHub Desktop.
Save sudmed/d3d021349e765c7e4c15a39033ae87d1 to your computer and use it in GitHub Desktop.
set -Eeuxo pipefail
set -Eeuxo pipefail
# set -e - Exit immediately if a command exits with a non-zero
# status. Note that failing commands in a conditional
# statement will not cause an immediate exit.
#
# set -o pipefail - Sets the pipeline exit code to zero only if all
# commands of the pipeline exit successfully.
#
# set -u - Causes the bash shell to treat unset variables as an
# error and exit immediately.
#
# set -x - Causes bash to print each command before executing it.
#
# set -E - Improves handling ERR signals
---
https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail
https://www.reddit.com/r/commandline/comments/g1vsxk/comment/fniifmk
http://redsymbol.net/articles/unofficial-bash-strict-mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment