Hacker News new | ask | show | jobs
by TorKlingberg 3376 days ago
Well, for scripts. set -e on an interactive shell is a bit of a challenge.
2 comments

A 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...
interactive commands should abort the command on unset variable
"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!
> Imagine an interactive shell exiting as soon as a user's command failed!

Hardcore mode.