Artificial intelligent assistant

how to check the string is Null or not in shell script? I had a script like this #!/bin/bash line="hello" if [ -z $line ] ; then echo "String null" fi This will work properly, but when I give the `line`as follows line="hello welcome" It will through the error as a.sh: 5: [: hello: unexpected operator In that situation , how can I check that is Null or not ??

In the if condition give the $line in the double quotes it will work fine


#!/bin/bash
line="hello welcome "

if [ -z "$line" ] ; then
echo "String null"
fi

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f09451d8e177ffb908336ef500db1099