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
