[问题] script 新手的问题 谢谢
发表于 : 2008-03-02 23:18
一个程序如下
#!/bin/bash
if [ "$1" == "hello" ]; then
echo "Hello, how are you ?"
elif [ "$1" == "" ]; then
echo "You MUST input parameters, ex> $0 someword"
else
echo "The only parameter is 'hello'"
fi
可是运行会出现下列错误..
[: 14: ==: unexpected operator
[: 14: ==: unexpected operator
The only parameter is 'hello'
谢谢回答
#!/bin/bash
if [ "$1" == "hello" ]; then
echo "Hello, how are you ?"
elif [ "$1" == "" ]; then
echo "You MUST input parameters, ex> $0 someword"
else
echo "The only parameter is 'hello'"
fi
可是运行会出现下列错误..
[: 14: ==: unexpected operator
[: 14: ==: unexpected operator
The only parameter is 'hello'
谢谢回答