2018/06/01

Bash help

set -e : Exit immediately if a command exits with a non-zero status
set -u : Treat unset variables as an error when substituting

set -o pipefailNormally, pipelines only return a failure if the last command errors. In combination with set -e, this will make your script exit if any command in a pipeline errors.