4 ms·
Slightly more useful than `set -e` is `set -E` and `trap exit ERR`. But still there's basically no way to make this consistently useful. Even if you religious
by ben0x539 9y ago
Slightly more useful than `set -e` is `set -E` and `trap exit ERR`.
But still there's basically no way to make this consistently useful.
Even if you religiously set -e/E in every scope just in case, if you're anywhere in a scope inside the non-final operand of a bunch of &&/||s, or as the conditional expression in a control structure or whatever, -e/E will just do nothing, you can't turn it any more on, you just don't get early termination on errors no matter how many nested function calls you're actually removed from the original ||. It's not great.