Variable name case

Note that in our example assignments earlier, variable names such as  myshell and today are in lowercase. Very often, when you read shell scripts others have written, particularly older scripts, you will find that variables that are used only internally in the script are written in uppercase, such as MYSHELL.

The issue with using the ALL_UPPERCASE variable names for your own script variables is that environment variables, such as HOME, and shell internal variables, such as BASH_VERSION, are also (almost) always written in uppercase, and there are a lot of them  so if you use capitalized names, there is a significant risk of accidentally breaking an important variable in your own script.

For example, if you were to assign ...

Get Bash Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.