4 ms·
Using the shebang just helps highlight the fact that the rule is in use globally, but otherwise has no advantage to using `set -u`. The clarifications on `-u`
by mr-wendel 3y ago
Using the shebang just helps highlight the fact that the rule is in use globally, but otherwise has no advantage to using `set -u`.
The clarifications on `-u` and arrays are useful. I'm definitely used to assuming newer (... non-ancient?) versions of Bash are what is available.
- Xophmeister 3y agoUsing `set -u` is more portable. If your shebang is `/usr/bin/env bash`, which it probably should be, then you can't add additional command line arguments in Linux with older coreutils. macOS supports additional arguments, regardless, and in Linux, coreutils 8.30 added the `-S` option to `env` to get around this problem.