天天看点

shell中如何判断一个字符串是否为空

例如:

$name='Marry'

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

    echo "name is empty"

else

    echo "name is not empty"

fi