判断变量为空
if [ ! -n "$word" ] ;then
echo "you have not input a word"
else
echo "the word you input is $word"
fi
直接判断
if [ ! "$word" ] ;then
echo "you have not input a word"
else
echo "the word you input is $word"
fi
使用test判断
if test -z "$word" ;then
echo "you have not input a word"
else
echo "the word you input is $word"
使用"“判断
if [ "" = "$word" ] ;then
echo "you have not input a word"
else
echo "the word you input is $word"
fi