3 ms·
Bash shepherds you into ignoring errors and using maybe-blank values everywhere.
by marcosdumay 7y ago
Bash shepherds you into ignoring errors and using maybe-blank values everywhere.
- l0b0 7y agoYou can improve that situation somewhat by starting scripts with `set -o errexit -o noclobber -o nounset -o pipefail` and `shopt -s failglob` to fail fast.
- marcosdumay 7y agoYes, this makes things better. But then you will have to deal with the non-negligible amount of programs that use the exit value to return information. It is still better to place exceptions on failing code than to ignore errors that can wipe out your entire system, but it's not really good either way.