Shell中大小写转换的方法
使用tr就可以实现
大写转小写
1 | table=`echo $line | tr '[:upper:]' '[:lower:]'` |
小写转大写
1 | table=`echo $line | tr '[:lower:]' '[:upper:]'` |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
使用tr就可以实现
1 | table=`echo $line | tr '[:upper:]' '[:lower:]'` |
1 | table=`echo $line | tr '[:lower:]' '[:upper:]'` |