英文大小写转换

sed 's/\b[a-z]/\U&/g' file
[root@linux6 ~]# echo "Welcome To Tianqu" | sed 's/\b[A-Z]/\l&/g'
welcome to tianqu
[root@linux6 ~]# echo "Welcome To Tianqu" | sed 's/\B[a-z]/\U&/g'
WELCOME TO TIANQU
[root@DBhost165 ~]# echo "welcome to linux" | sed 's/\b[a-z]/\U&/g'
Welcome To Linux
 

本文出自 “HQY's 运维人生” 博客,谢绝转载!

你可能感兴趣的:(英文大小写转换)