开发者

syntax error near unexpected token error in shell script

i have the following shell script-

#!/bin/bash
echo "enter the full path of开发者_如何学Go script";
read path;
while true
    ps aux | grep -v grep | grep -q $path || ( nohup php -f $path & )
done

I am executing in following way -

bash test.sh
enter the full path of script
php_test.php
test.sh: line 7: syntax error near unexpected token `done'
test.sh: line 7: `done'

there is a php_test.php in the same directory as the present one. PLease help. Thanks in advance.


From help while:

while: while COMMANDS; do COMMANDS; done

You're missing the do.

while true
do
 ...
done
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜