What does set -u do in bash script?

I’ve seen bash shell scripts which have this before some other commands

set -u

What does it do? I can’t seem to find any documentation on it.

Asked By: lacostenycoder

-u  Treat unset variables as an error when substituting.

You can give this page a try :

Set Man Page

Answered By: Pacifist
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.