Style consideration for shell script `set` directives
Ticket #33604 (closed) wants shell scripts to be more pedantic. However, looking at current scripts, some use set -e
and others use the longer verbose set -o errexit
, so which do we want?
Furthermore there is also the option to set these in the shebang line (i.e. #!/bin/sh -eu
), which to me is nicer because it's clear that these flags apply to the script. When adding code we definitely don't want someone to place any lines of code above the set -eu
, so having it in the shebang would prevent that.