Created
June 20, 2017 23:33
-
-
Save anonymous/573b9f79074d447e6f6201a91c3e8d4c to your computer and use it in GitHub Desktop.
Demonstrating What does set -e mean? Simple: Run each file with your internet connection turned on/off and spot the difference.
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 -e | |
wget -O /tmp/example.html example.com; cat /tmp/example.html | wc > /tmp/wordcount.txt | |
echo "Hello! If we got this far, eveything was a sucess hooraryy!" |
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 | |
# If wget fails in this script, the pipe to wc will continue regardless | |
# This might be bad and not what we want. | |
wget -O /tmp/example.html example.com; cat /tmp/example.html | wc > /tmp/wordcount.txt | |
echo "Hello! If we got this far, eveything was a sucess hooraryy!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment