changing upper/lower case with tr
August 4th, 2006 mysurface Posted in Text Manipulation, tr | Hits: 34054 | 2 Comments »
tr is actually a common translator, here I show you how to convert
string from uppercase to lowercase
echo "UPPER" | tr [A-Z] [a-z]
from lower to upper
echo "lower" | tr [a-z] [A-Z]
ï¼»ä¸æ–‡ç¿»è¯‘ï¼½







May 30th, 2011 at 1:10 am
you need quotes on some linux (ubuntu)
echo “UPPER” | tr “[A-Z]” “[a-z]“
January 31st, 2013 at 10:54 pm
tr ‘[[:upper:]]’ ‘[[:lower:]]’
or
tr ‘[[:lower:]]’ ‘[[:upper:]]’