In one of my lab tutorial there was a command to be checked.
test -z $LOGNAME || echo Logname is not defined
when I execute this command the output is "Logname is not defined". Man page for test says
> -z STRING > the length of STRING is zero
when I echo $LOGNAME it prints out my login name. So there is a value for $LOGNAME. In the first command above since the right part of the command is executed, it implies the left part has returned false. Why does it return false when $LOGNAME has a value?