|
发表于 2007-6-27 10:37:25
|
显示全部楼层
abs中提到的
in a compound test, even quoting the string variable
might not suffice. [ -n "$string" -o "$a" = "$b" ] may cause an error
with some versions of Bash if $string is empty. The safe way is to
append an extra character to possibly empty variables, [ "x$string" != x
-o "x$a" = "x$b" ] (the "x's" cancel out). |
|