ArchSetu
ArchSetu
ArchSetuToolsLinuxBash Strict Mode Header Generator
Free tool

Bash Strict Mode Header Generator

Pick set -e, set -u, pipefail, safe IFS, and an error trap - a commented script header explaining what each one actually catches.

#!/usr/bin/env bash

# Exit immediately if any command fails, instead of continuing with a partially-completed script.
set -e

# Treat unset variables as an error - catches typos in variable names instead of silently expanding to empty.
set -u

# A pipeline fails if ANY command in it fails, not just the last one - without this, `false | true` exits 0.
set -o pipefail

Was this tool helpful?

See this same kind of analysis applied to your whole repository

Call graphs, dead code, blast radius, and a health score. Results in 60 seconds, free.

Analyze a repository

Runs entirely in your browser. Nothing is stored. Free forever.

Powered by ArchSetu