Wednesday, January 14, 2015

convert string to lower case in bourne shell

#!/bin/sh
str="This is My TESTing String"

method1=`echo ${str} | tr '[A-Z]' '[a-z]'`
method2=`echo ${str} | tr '[:upper:]' '[:lower:]'`

echo ${method1}
echo ${method2}

No comments: