天天看點

shell中如何判斷一個字元串是否為空

例如:

$name='Marry'

if ["X${name}" == "X"];then

    echo "name is empty"

else

    echo "name is not empty"

fi