May 3, 2018
Shell 技巧:大小写, strtoupper, strtolower, ucwords, ucword
1. strtoupper
echo "justcode.ikeepstudying" | tr '[:lower:]' '[:upper:]'
#JUSTCODE.IKEEPSTUDYING
其他方法:
echo 'justcode.ikeepstudying.com' | awk '{print toupper($0)}'
#JUSTCODE.IKEEPSTUDYING
echo "justcode.ikeepstudying.com" | tr /a-z/ /A-Z/
#JUSTCODE.IKEEPSTUDYING.COM
$ tr [a-z] [A-Z] < convert_to_uppercase.txt
#JUSTCODE… Read More