Shell
You're viewing a free preview. Sign in free to read every script.
Why this exists By default a shell script keeps running after a command fails, treats unset variables as empty strings, and ignores failures in the middle of a pipeline. That is how a deploy script ends up running rm rf…
A Safe Script Template: Strict Mode, Traps, Cleanup and Option Parsing
A reusable starting point for every script: strict mode, a usage message, getopts option parsing, temp-file cleanup and error reporting with trap, and the caveats of set -e you need to know.
Sign in free to read this script, along with the rest of the library.
Sign in free