分页: 1 / 1

新手: 关于 ifthen的问题。谢谢回复

发表于 : 2009-12-14 14:49
washion
我的代码是:
#!/bin/bash
#This program is used to study if then
#user 2009/12/14
if [ "$1" = "hello" ]; then
echo "Hello! How are you ?"
elif [ "$1" = " " ]; then
echo "You MUST input parameters"

else
echo "The only accept parameter is hello"
fi

elif [ "$1" = " " ]; then
echo "You MUST input parameters" 这两行代码始终不执行,请问是什么原因阿?谢谢

Re: 新手: 关于 ifthen的问题。谢谢回复

发表于 : 2009-12-14 14:56
xzap
你的" "之间貌似有空格

Re: 新手: 关于 ifthen的问题。谢谢回复

发表于 : 2009-12-14 16:16
washion
非常感谢!!已经可以正常运行了。我买的这本书上有很多错误,太烦了!