Created
August 23, 2021 12:40
-
-
Save zored/bdf010ec180c30c516c4586d8e131349 to your computer and use it in GitHub Desktop.
Safe 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 -ETexuo pipefail | |
shopt -s inherit_errexit | |
# -e - stop on error. | |
# -E - traps will work with -e. | |
# -x - debug output each command. | |
# -u - error on unexpected variables. | |
# -o pipefail - handle errors of '|'. | |
# -s inherit_errexit - fail in subshell failures. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment