The tips and tricks below originally appeared as one of Google's "Testing on the Toilet" (TOTT) episodes. This is a revised and augmented version. Safer Scripting I start every bash script with the following prolog: #!/bin/bash set -o nounset set -o errexit This will take care of two very common errors: Referencing undefined variables (which default to "") Ignoring failing commands The two setting