4 ms·
No no no. Clearly sh and bash are just broken. We need to write scripts in Rust or Haskell to avoid safety issues. </sarcasm>
by IgorPartola 10y ago
No no no. Clearly sh and bash are just broken. We need to write scripts in Rust or Haskell to avoid safety issues. </sarcasm>
- coldtea 10y agoWell, 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...
- the_why_of_y 10y agosh is fundamentally broken as soon as you use a pipe in a command; bash at least has "set -o pipefail".