<p>Use <a rel="nofollow" href="https://stackoverflow.com/questions/673055/correct-bash-and-shell-script-variable-capitalization">https://stackoverflow.com/questions/673055/correct-bash-and-shell-script-variable-capitalization</a> as a reference.<br>
A few things are important here:
The bash software has some default variables in your system that you don't want to "accidentally overwrite".
Nevertheless, exported variables should be all caps with underscores. (An exported variable is when you literally write something like export JAVA_HOME="$HOME/java".)
Nevertheless, constants should be all caps with underscores. (I think technically a constant is a variable does not change after declaration. However this seems to be too broad of a scope, because often one creates a "quick/temporary" variable that is not changed simply because it is used only once, yet I think that is not a constant as intended in bash. Therefore, I think a constant is better defined as: a variable that does not change after creation and that is used across multiple scripts. I think a good example of a constant would be the hardcoded file locations of certain configuration files that may be used by multiple scripts.
All other personal/temporary/normal variables should be in snake case.
So theoretically an issue could be that one "accidentally overwrites" the list of bash default variables (either with a exported value or a constant). To prevent this you could add a prefix to minimise the odds of accidentlly naming your exported variable/constant the same as a bash default variable. For example instead of writing OUTPUT_FILEPATH, one could add prefix LOG_ to write: LOG_OUTPUT_FILEPATH.
A few things are important here:
export JAVA_HOME="$HOME/java"
.)So theoretically an issue could be that one "accidentally overwrites" the list of bash default variables (either with a exported value or a constant). To prevent this you could add a prefix to minimise the odds of accidentlly naming your exported variable/constant the same as a bash default variable. For example instead of writing
OUTPUT_FILEPATH
, one could add prefixLOG_
to write:LOG_OUTPUT_FILEPATH
.