shell 将输入的字符转换成大写
test.sh
#!/bin/bash while read line do echo $line | tr '[a-z]' '[A-Z]' done
输出
dddddd
DDDDDD
sssss
SSSSS
cdcdcdc
CDCDCDC
ssssssssssss
SSSSSSSSSSSS
test.sh
#!/bin/bash while read line do echo $line | tr '[a-z]' '[A-Z]' done
输出
dddddd
DDDDDD
sssss
SSSSS
cdcdcdc
CDCDCDC
ssssssssssss
SSSSSSSSSSSS