1

我正在构建一个使用 while 循环的脚本,如下所示:

$sync=0
while [ $sync -eq 0 ];
do
body of the loop where $sync get changed sevaral times


done

问题是当我执行脚本时它给了我一个错误说:

enter code hereline 53: 0=0: command not found

请帮助我,提前谢谢

4

1 回答 1

2

更改$sync=0sync=0$bash 不是 perl,所以在分配给变量时不要使用。

请参阅http://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameters

PS,错误消息很有用:脚本中的第 53 行是什么?

于 2013-05-23T15:00:44.803 回答