Skip to content

Instantly share code, notes, and snippets.

@peebeebee
Created February 23, 2014 20:33
Show Gist options
  • Save peebeebee/9176850 to your computer and use it in GitHub Desktop.
Save peebeebee/9176850 to your computer and use it in GitHub Desktop.
Exit shell on error
#!/bin/sh -e
/*
When this option is on, if a simple command fails for any of the reasons listed in Consequences of Shell Errors or returns an exit status value >0, and is not part of the compound list following a while, until, or if keyword, and is not a part of an AND or OR list, and is not a pipeline preceded by the ! reserved word, then the shell shall immediately exit.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment