Shell options
Default options that should always be set in shell scripts
-u: stop if a variable is unset, avoid unexpected behaviours-e: stop in case of errors, avoid silent errors and unwanted behaviour-o pipefail: fail if any step in a pipe fails, avoid silent errors in piped commands
#!/bin/bash
set -euo pipefail
There is a bunch of other options described in the doc.