1、typeset 
有两个选项 -l 代表小写 -u 代表大写。
用法:
typeset -u name
name='asdasdas'
echo $name
 
typeset -l ame
ame='asdasdas'
echo $ame
 
结果:
[lzk@localhost 33_class_3_26_shell]$ bash test.sh
ASDASDAS
asdasdas
 
 
2、利用表达式
 
echo 'hello' | tr 'a-z' 'A-Z'
echo 'HELLO' | tr 'A-Z' 'a-z'
结果:
 
HELLO
hello

相关文章:

  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-18
  • 2021-12-23
  • 2021-11-27
  • 2021-06-05
  • 2021-08-29
  • 2021-12-05
  • 2021-11-20
相关资源
相似解决方案