编辑代码

a="abc"
if [ $a ]
then
    echo "a不为空"
else
    echo "a为空"
fi