Is Bash shell scripting case sensitive?
Is variable date
the same as DATE
?
By convention, environment variables ( PAGER , EDITOR , ...) and internal shell variables ( SHELL , BASH_VERSION , ...) are capitalized. All other variable names should be lower case. Remember that variable names are case-sensitive; this convention avoids accidentally overriding environmental and internal variables.
$1 means an input argument and -z means non-defined or empty. You're testing whether an input argument to the script was defined when running the script. Follow this answer to receive notifications.
3. (macOS/Linux) Environment Variables. Environment variables in macOS/Unixes are case-sensitive. Global environment variables (available to ALL processes) are named in uppercase, with words joined with underscore ( _ ), e.g., JAVA_HOME .
Variable names are not case sensitive. That is, you can use a name as uppercase on one line and lowercase on the next; both refer to the same variable. Production Reporting initializes variables to null (text and date) or zero (numeric).
Yes, it is case sensitive, just like the rest of UNIX. $date
and $DATE
are two different variables. makefile
and Makefile
are two different files. -h
and -H
are two distinct flags (usually).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With