Best practices
Start scripts with the following flags:
set -euo pipefail
set -x
set -e
: immediately exit if any command has a non-zero exit codeset -u
: immediately exit if any undefined variables are usedset -o pipefail
: immediately exit if any command in a pipeline failsset -x
: print each command being run with its values