et -euf -o pipefail In dash, set -o doesn't exist, so use only set -euf . What do those do? set -e If a command fails, set -e will make the whole script exit, instead of just resuming on the next line. If you have commands that can fail without it being an issue, you can append || true or || : to suppress this behavior — for example set -e followed by false || : will not cause your script to terminate. set -u Treat unset variables as an error, and immediately exit. set -f Disable filename expansion (globbing) upon seeing * , ? , etc.. If your script depends on globbing, you obviously shouldn't set this. Instead, you may find shopt -s failglob useful, which causes globs that don't get expanded to cause errors, rather than getting passed to the command with the * intact. set -o pipefail set -o pipefail causes a pipeline (for example, curl -s ...
Comments
Post a Comment