2 ms·
Well, Rust and Haskell might not be for the job, but sh and bash are clearly broken and in many ways. -eu should have been the default from the start, for one.
by coldtea 10y ago
Well, Rust and Haskell might not be for the job, but sh and bash are clearly broken and in many ways.
-eu should have been the default from the start, for one.
- TorKlingberg 10y agoWell, for scripts. set -e on an interactive shell is a bit of a challenge.
- harryjo 10y agointeractive commands should abort the command on unset variable
- tomjakubowski 10y ago"Abort command if variables are unset" is the -u flag, not -e. Both were mentioned long ago in this thread, but GP was talking about -e being painful for interactive shells. Imagine an interactive shell exiting as soon as a user's command failed!
- dllthomas 10y ago> Imagine an interactive shell exiting as soon as a user's command failed! Hardcore mode.
- coldtea 10y agoA shell could, and I'm going out on a limb here, check whether it's interactive or not and just enforce the -e in the appropriate case...