"errors" comic strip by Julia Evans @b0rk panel 1: "by default, bash will continue after errors" beneath is a bash-box saying "oh, was that an error? who cares, let's keep running!!!" and a programmer saying "uh that is NOT what I wanted" "set -e stops the script on errors" with a programmer beneath saying "this makes your scripts WAY more predictable" next to words "set -e /n unzip fle zip" and a note pointing to the .zip line "typo! script stops here!" panel 2: "by default, unset variables don't error" followed by "rmb-r "$HOME/$SOMEPTH" and a bash box "$SOMEPTH doesn't exist? no problem, I'll just use an empty string!" and a programmer "OH NOOOO that means rm -rf $HOME" then "set -u stops the script on unset variables" followed by "set -u /n rm -r "$HOME/$SOMEPTH" and a bash box saying "I've never heard of $SOMEPTH! STOP EVERYTHING!!!" panel 3: "by default, a command failing doesn't fail the whole pipeline" followed by "curl yxqzq.ca | grep 'panda'" and a bash box saying "curl failed but grep succeeded so it's fine! success!" then "set -o pipefail makes the pipe fail if any command fails" followed by "you can combine set -e, set -u, and set -o pipefail into one command I put at the top 9f all my scripts: 'set -euo pipefail'"
https://cijber.social/system/media_attachments/files/113/032/882/092/889/836/original/1d878ab74bfe3604.jpg