2 ms·
do beginner bash guides not tell you to "set -u"? all the system scripts on my system have it it causes the script to terminate with an error if it encounters
by blibble 7y ago
do beginner bash guides not tell you to "set -u"? all the system scripts on my system have it
it causes the script to terminate with an error if it encounters use of an unset variable
- tetha 7y agoNot just -u - always <set -euo pipefail> unless you have a good reason. Fail on non-zero exit code outside of some special cases, undefined variables, and non-zero exit codes in a pipeline. And always use shellcheck, shellcheck is too good not to use tbh.