3 ms·
Yeah there's no good solution for this in shell -- you're damned if you do, and damned if you don't. bash has inherit_errexit to fix a longstanding bug, but ev
by chubot 7y ago
Yeah there's no good solution for this in shell -- you're damned if you do, and damned if you don't.
bash has inherit_errexit to fix a longstanding bug, but even that's not enough.
Oil has shopt -s strict_errexit and more_errexit that fixes even more.
https://github.com/oilshell/oil/issues/476 https://github.com/oilshell/oil/issues/476
I'm still looking for feedback and there's probably one more thing I want to change.
Although the fundamental problem is that errors (success/fail) and boolean values (true/false) are conflated in the status code, so it's a tough problem.
In Oil you will be encouraged to use expressions for booleans, not statements, e.g.
ls / # success/fail
if (x > 0) { } # true/false
rather than
ls /
if test $x -lt 0; then ...