Case statements use the file name generation feature of the shell which is normally case-insensitive as documented in the sh(1) reference page. If you want to make file name generation case-sensitive then set the variable DUALCASE to a non-zero value.
Example:
DUALCASE=1
case “$1” in
-r*) echo r;;
-R) echo R;;
*) echo other
esac
unset DUALCASE
Note: As of version 7.5 a new variable has been added. Setting TK_DUALCASE_IN_CASE_STATEMENTS to any value will make pattern-matching in case statements case-sensitive. When TK_DUALCASE_IN_CASE_STATEMENTS is not set, the DUALCASE environment variable determines whether or not pattern-matching is case-sensitive in the same way it does for file name generation. |