2011-01-10 141 views
2

我有以下shell腳本 -語法錯誤

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

我在下面的方式執行 -

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' 

存在的相同目錄下php_test.php作爲目前的一個。請幫忙。提前致謝。

+0

此問題與php無關。 – zerkms 2011-01-10 09:13:10

回答

4

help while

while: while COMMANDS; do COMMANDS; done 

你錯過了do

while true 
do 
... 
done