Categories

请点击这里

What should be noticed while using -n and -z Bash expression

[ -z $string ] is very easy to use. We use this expression to test whether the string is empty or undefined.
But I did meet problem when use [ -n $string ]. It seemed that it returned true anyway, no matter the $string is empty or defined or not-defined.
But when I double quoted the variable, [...]