String expression

1, test operation symbols all strings must be enclosed in double quotes;

2, both ends must be a space symbol comparison;

Common string test operators

the -Z "String" If the string length is zero True 0

-n "string" If the length is not 0 True no zero

"String 1" = "String 2" if the string is equal to 1 True 2 strings, can be used instead of = ==

"String 1"! = "String 2" if the string is not equal to 1 True 2 strings, not! == instead of! =

 

Guess you like

Origin www.cnblogs.com/zhutao-niuniu2014/p/11583517.html