4 ms·
Well, for scripts. set -e on an interactive shell is a bit of a challenge.
by TorKlingberg 10y ago
Well, 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...