Skip to content

Common set options for robust scripts

Enable errexit, errtrace, nounset, pipefail, and xtrace.

18th August 2026

set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
set -o xtrace

Caveats

xtrace is on, so every command is printed. Comment it out for normal use.