huasen 发表于 2003-12-25 18:57:57

请教:运行到脚本中的elif和setenv等出错??

我用的是Rh9
有几个脚本,说是在RH7.3中测试通过的
但我在RH9中运行时出错
line 77: syntax error near unexpected token `elif'
line 77: ` elif [ "$1" = "?" -o "$1" = "-h" -o "$1" = "-help"
']
我把elif改成elseiffi(原script中是if fi配对的)后
这里运行通过
但在setenv那又卡死了
谁能告诉我是怎幺回事,有什幺解决方案吗?

因为我不是学计算機的,问的可能比较傻,
还望能不耻下教!
谢谢!

powerme 发表于 2003-12-26 03:47:46

不耻下教!:mrgreen::mrgreen:

try
elif [ "$1" == "?" -o "$1" == "-h" -o "$1" == "-help"
']

huasen 发表于 2003-12-26 19:56:55

那setenv的又怎么辦呢?
謝謝!

huasen 发表于 2003-12-27 19:35:50

$ sh ./setup
: command not found
./setup: line 78: syntax error near unexpected token `elif'
'/setup: line 78: `elif [ "$1" = "?" -o "$1" = "-h" -o "$1" = "-help" ]
$

huasen 发表于 2003-12-27 19:41:45

$ sh ./setup
: command not found
./setup: line 78: syntax error near unexpected token `elif'
'/setup: line 78: ` elif [ "$1" == "?" -o "$1" == "-h" -o "$1" == "-help" ]
$
页: [1]
查看完整版本: 请教:运行到脚本中的elif和setenv等出错??