Created
July 31, 2018 20:22
-
-
Save pjjw/83a8aa5625dabca0df8f271b31064fac to your computer and use it in GitHub Desktop.
bash is cool
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
#!/bin/bash | |
set -euo pipefail | |
set -x | |
if [ ! -z "$(echo foo)"]; then | |
echo "we should never get here" | |
exit 1 | |
fi | |
echo "we should never get here either" |
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
$ bash bad.sh | |
++ echo foo | |
+ '[' '!' -z 'foo]' | |
bad.sh: line 5: [: missing `]' | |
+ echo 'we should never get here either' | |
we should never get here either |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment