Created
February 8, 2017 17:30
-
-
Save nicdoye/c27d491647d366c32e5b79443913e94a to your computer and use it in GitHub Desktop.
bash gotcha
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
# This is what you'd expect - prints 1 | |
declare var | |
var=$(false) | |
echo $? | |
# This does not do what you'd expect - prints 0 | |
declare var2=$(false) | |
echo $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment