3 ms·
it's never had an option to make "-e" do the obviously natural behaviour,, This is harder than it sounds! :) There's arguably not a natural behavior for she
by chubot 4y ago
it's never had an option to make "-e" do the obviously natural behaviour,,
This is harder than it sounds! :) There's arguably not a natural behavior for shell, because $? is overloaded in Unix. It can mean success/failure or it can mean true/false/error.
https://www.oilshell.org/release/latest/doc/error-handling.html#what-does-mean https://www.oilshell.org/release/latest/doc/error-handling.h...
Oil introduces some new idioms that led you distinguish between the two paradigms, so it's best to change the way you write scripts. It's not something bash can magically fix.
https://www.oilshell.org/release/latest/doc/idioms.html#error-handling https://www.oilshell.org/release/latest/doc/idioms.html#erro...
That said, just running your scripts with Oil will flag problems, acting like a ShellCheck at runtime, catching things that ShellCheck can't.
See the sibling reply for a demo, and this comment:
https://news.ycombinator.com/item?id=33117337 https://news.ycombinator.com/item?id=33117337