Bash version 4+(initially released in Feb,2009) can convert case of a character to upper or lower case using parameter substitution feature. This feature also properly converts non english unicode characters where tr [:upper:] [:lower:] may not support it.
Below are the supported options with this feature,
Please find below example for using this feature.
string='HellO WoRlD'
echo ${string} #HellO WoRlD
echo ${string^^} #HELLO WORLD
echo ${string,} #hellO WoRlD
echo ${string,,} #hello world
echo ${string~} #hellO WoRlD
echo ${string~~} #hELLo wOrLd
echo ${string} #HellO WoRlD - string variable itself is unmodified
Note:
Some initial versions of
Bashhad a bug properly converting non english characters and Bash versions 4.3+ should work without any issues.
References: