4 ms·
To expound on this: "set -e" is short for "set -o errexit", that is, abort the script if a command returns with a non-zero exit code. "set -u" is short for "s
by wolfgang42 10y ago
To expound on this:
"set -e" is short for "set -o errexit", that is, abort the script if a command returns with a non-zero exit code.
"set -u" is short for "set -o nounset", that is, abort the script if a variable name is dereferenced when the variable hasn't been set.
I also strongly suggest reading http://www.davidpashley.com/articles/writing-robust-shell-scripts/ http://www.davidpashley.com/articles/writing-robust-shell-sc... for more things that you should be aware of when writing bash scripts.