tr

参考

tr -dc

tr -d

大小写替换

echo abc|tr '[a-z]' '[A-Z]'  

str="This is a Bash Shell script."

newstr=`tr '[A-Z]' '[a-z]' <<<"$str"`

原文地址:https://www.cnblogs.com/hanxing/p/4240217.html