how to convert value in a variable from upper case to lower case

Hi, I have a variable $Ctrcd which contains country names in upper case and i want to convert them into lower case. I have tried so many solutions from already existing threads but couldn't get the correct one.

Can anybody help me with this.....

Thanks a lot..

Newvariable=$( echo "$Ctrcd" | tr -s  '[:upper:]'  '[:lower:]' )
1 Like

Hi,

Thanks for ur help. it works fine. Just i changed it a little bit by exhanging [:lower:] and [:upper:] classes bcoz this code is converting from lower to upper case..