开发者

bash script parameters problem

i can't figure out, where is the problem

if [ $# -eq 1 ]; then
    if [ "$1"=="-h" ]; then
            help
    else
            echo "bad parameter, if you put only one 开发者_C百科parameter, you can choose only -h"
    fi

no matter what i give it as first parameter, script never gets to the else part and every time it is displaying help


Correct syntax:

if [ "$1" = "-h" ]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜