Ugh. If I have to write Bash, I try to enforce some level of basic sanity with:
set -euo pipefail
I've seen way too many scripts catastrophically fail because of unbound variables or one side of a pipe failing and the script continuing anyways, etc.