If I want to check for the null string I would do
[ -z $mystr ]
but what if I want to check whether the variable has been defined at all? O
A shorter version to test undefined variable can simply be:
test -z ${mystr} && echo "mystr is not defined"