Use "shellcheck -euo pipefail" in all scripts.
To avoid shell scripting errors, we want the script to exit when things go badly. The usual incantation is set -euo pipefail
, meaning:
-
-e
: exit on first failed command -
-u
: treat unset variables as failures -
-o pipefail
: treat pipelines as failed if any command in them fails.