I think I understand -z. If a variable is empty test will return true.
But I don't understand -n. man test tells me:
-n string True if the length of string is nonzero.
So I execute these command lines:
bash-3.2$ thing=abc
bash-3.2$ test -z $thing && echo "x${thing}x"
bash-3.2$ test -n $thing && echo "x${thing}x"
xabcx
bash-3.2$ thing=""
bash-3.2$ test -z $thing && echo "x${thing}x"
xx
bash-3.2$ test -n $thing && echo "x${thing}x"
xx
Why does test -n $thing && echo "x${thing}x" output xx?
Doesn't $thing have a length of zero?
Shouldn't test -n $thing have returned false?