Fundamentals17 / 17
Up next

Strict mode

#!/usr/bin/env bash
# -e exit on error, -u error on unset vars, -o pipefail catch pipe failures
set -euo pipefail
name="Ada"
# with -u, a typo'd variable would abort instead of expanding empty
echo "strict run for $name"
What you're solving

set -euo pipefail catches errors early