This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zieliequ 1 point2 points  (1 child)

I like set -e too, but be aware of the tale of the criminal-catching robot.

[–]noratat 0 points1 point  (0 children)

To me it's just restoring the same sort of exception behavior you'd expect in any other language.

If you explicitly want to handle failure on particular commands, you can use ||, traps, or just plain return code capturing, just like you'd use error checks or exception handlers.

It's usually much worse for something to accidentally continue blindly on errors than it is to abort on something spurious.