Catch common bash errors in sbws scripts
We're going to gradually update tor, chutney, and fallback-scripts bash scripts to catch more errors. sbws might also want to make similar changes.
I'm not sure if sbws uses shellcheck already. Shellcheck helps catch errors while writing scripts.
To catch more runtime failures, set these options at the start of each script:
set -e
set -u
set -o pipefail
You might also want to set:
IFS=$'\n\t'
But it can change how lists are processed.
These settings help catch common errors in bash scripts at runtime: http://redsymbol.net/articles/unofficial-bash-strict-mode/
But they can cause scripts to fail, so you should have good unit tests and CI for all your scripts, before making these changes.
Follow-up to #33451 (moved).