set -u
orset -o nounset
- By default, unset variables are just evaluated as if they were the empty string.
- With this option, BASH stops and fail if you try to use an unset variable.
#### Without Nounset
bash ./examples/options/options_without_nounset.sh
#### With Nounset filename
bash ./examples/options/options_with_nounset.sh
#### DON'T TRY AT HOME
rm -rf "$DIRECTORY/*"
### References