Skip to content

Instantly share code, notes, and snippets.

View wolfgangschaefer's full-sized avatar

Wolfgang Schaefer wolfgangschaefer

View GitHub Profile
@robin-a-meade
robin-a-meade / unofficial-bash-strict-mode.md
Last active June 17, 2024 15:33
Unofficial bash strict mode

Unofficial Bash Strict Mode

Sometimes a programming language has a "strict mode" to restrict unsafe constructs. E.g., Perl has use strict, Javascript has "use strict", and Visual Basic has Option Strict. But what about bash? Well, bash doesn't have a strict mode as such, but it does have an unofficial strict mode:

set -euo pipefail

set -e