Bash字符串处理

字符串大小写

字符串大小写转换在Bash中有非常巧妙的方法,无需第三方工具,内置提供了参数扩展:

使用bash内置参数扩展实现字符串大小写转换
$ string="leVel"
$ echo "${string,,}"
level
$ echo "${string^^}"
LEVEL

参考