Writing shell scripts you will not regret

Begin every serious Bash script with set -euo pipefail so it fails fast instead of limping along after an error.