【 以下文字转载自 Linux 讨论区,原文如下 】
发信人: wenxiangli (Thrall), 信区: Linux
标 题: a simple but weird question about the usage of "test" in RH6.2 !
发信站: The unknown SPACE (Fri Dec 29 20:06:44 2000) WWW-POST
$1> set a="hello"
$2> set b #empty string
$3> test $a;echo $?
0
$4> test $b;echo $?
1
$5> test -n $a;echo $?
0
$6> test -n $b;echo $?
0 #?????????????!!!!!!!
$7> test -z $a;echo $?
1
$8> test -z $b;echo $?
0 #!!!
Could any DaXia give an explaination about