set -u

The shell option that makes using an unset variable an error that stops the script, instead of silently expanding to nothing.

In more detail

It catches mistyped names such as $nmae before they cause damage, for example an rm with an empty path. Use ${var:-} where a variable is allowed to be missing.

Related terms

Taught in

References