QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2571|回复: 1

新手提问 shell scripts

[复制链接]
发表于 2009-8-5 15:43:38 | 显示全部楼层 |阅读模式
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? 这是怎么回事?! 谢谢!!
发表于 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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-3-28 23:00 , Processed in 0.114699 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表