Created
March 31, 2016 18:51
-
-
Save rcrowley/724970de828cb445e14e958efa5ac2f0 to your computer and use it in GitHub Desktop.
This is very important if you write shell programs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
█ $ cat false-trap-true.sh | |
set -e -x | |
trap false EXIT | |
true | |
█ $ cat true-trap-false.sh | |
set -e -x | |
trap true EXIT | |
false | |
█ $ sh false-trap-true.sh; echo $? | |
+ trap false EXIT | |
+ true | |
+ false | |
1 | |
█ $ sh true-trap-false.sh; echo $? | |
+ trap true EXIT | |
+ false | |
+ true | |
1 | |
█ $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment