标签:sh变量特性
echo ${#A}
结果:12A='Hello world!'
echo ${A:-OK}
结果:Hello wold!
unset A或 A=’’
echo ${A:-OK}
结果:OKA='Hello world!'
echo ${A:+OK}
结果:OK
unset A 或A=’’
echo ${A:+OK}
结果:A='Hello world!'
echo ${A:=OK}
结果:Hello world!
unset A 或A=’’
echo ${A:=OK}
结果:OK
echo $A
结果:OKA='Hello world!'
echo ${A:3}
结果:Hello world!A='Hello world!'
echo ${A:3:4}
结果:Hello world!标签:sh变量特性
原文地址:http://blog.51cto.com/lythjq/2073516