3 ms·
I've encountered a fair number of people who blindly set -eu on every script as a matter of course, as suggested by the author here. While this article goes thr
by skuhn 11y ago
I've encountered a fair number of people who blindly set -eu on every script as a matter of course, as suggested by the author here. While this article goes through a bunch of the pitfalls, in my experience people often fail to account for the many (sometimes unintuitive) ways this can cause an abrupt exit. Sometimes stopping halfway through is just as bad as continuing under false assumptions, particularly if the script is so simplistic that it isn't obvious to the user that it exited midway through.
I almost never use -e, and as a result I have to stay vigilant and test return codes all over the place. I prefer that to the kludge of forcing everything to return zero and I think it produces overall better results. Ultimately you want to handle an error, not just abort, and -e doesn't do much to promote handling properly.