angelppp2008 发表于 2009-8-5 15:43:38

新手提问 shell scripts

if[ "$1"=="hellp" ];then
echo "Hello! How are you?"
elif [ "$1"=="" ];then
echo "You must input paramenters"
else
echo "The only accept parameter is hello"
fi

无论现在输什么都是 Hello!How are you? 这是怎么回事?! 谢谢!!

mimimomu 发表于 2011-12-26 15:38:21

少了空格:
if[ "$1" == "hellp" ];then
echo "Hello! How are you?"
elif [ "$1" == "" ];then
echo "You must input paramenters"
else
echo "The only accept parameter is hello"
fi
页: [1]
查看完整版本: 新手提问 shell scripts