Sprawdź, czy łańcuch nie jest ani pusty, ani spacji w skrypcie powłoki

Próbuję uruchomić następujący skrypt powłoki, który ma sprawdzić, czy łańcuch nie jest ani spacją, ani pustym. Jednak otrzymuję ten sam wynik dla wszystkich 3 wymienionych ciągów. Próbowałem również użyć składni „[[”), ale bezskutecznie.

Oto mój kod:

str="Hello World"
str2=" "
str3=""

if [ ! -z "$str" -a "$str"!=" " ]; then
        echo "Str is not null or space"
fi

if [ ! -z "$str2" -a "$str2"!=" " ]; then
        echo "Str2 is not null or space"
fi

if [ ! -z "$str3" -a "$str3"!=" " ]; then
        echo "Str3 is not null or space"
fi

Otrzymuję następujące dane wyjściowe:

# ./checkCond.sh 
Str is not null or space
Str2 is not null or space

questionAnswers(6)

yourAnswerToTheQuestion