When Failures Align
reeshill.net
reeshill.net
set -o errexit -o noclobber -o nounset -o pipefail
- Exit the script at the first non-zero exit code.- Do not allow clobbering existing files (overridden on a per-line basis when I actually want to clobber).
- Exit the script at the first undefined and un-defaulted variable dereference.
- Fail if any part of a pipeline fails.
and
shopt -s failglob
- Treat a glob with no matches as an error.A bonus of using long names is that they are easy to search for online.
More info: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_p...
I read that as the original reason for the reinstall everytime was not yet knowing how to build their own docker image. A reasonable place for a newbie to be. And a perfectly reasonable step to leave for future optimization.