tr命令¶
uppcase all chars:
$ echo "aBcDeF" |tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ // ABCDEF
or
$ echo "aBcDeF" |tr '[:lower:]' '[:upper:]'
uppcase the first char:
TYPE='abCdeFg'
PREFIX="$(tr '[:lower:]' '[:upper:]' <<< ${TYPE:0:1})${TYPE:1}"
echo $PREFIX