2011-04-29 20 views
5

Tôi gặp lỗi Syntax error: EOF in backquote substitution và tôi không có ý tưởng mờ nhạt tại sao. Liệu có ai muốn nhìn nhanh không?Lỗi cú pháp: EOF trong việc thay thế backquote

#! /bin/sh 
# chkconfig 345 85 60 
# description: startup script for produtcrawler-router 
# processname: producrawler-router 

NAME=productcrawler-router 
DIR=/etc/productcrawler/services 
EXEC=router.py 
PID_FILE=/var/run/productcrawler.pid 
IEXE=/etc/init.d/productcrawler-router 
RUN_AS=root 

### BEGIN INIT INFO 
# Provides:   productcrawler-router 
# Required-Start: $remote_fs $syslog 
# Required-Stop:  $remote_fs $syslog 
# Default-Start:  5 
# Default-Stop:  0 1 2 3 6 
# Description:  Starts the productcrawler-router service 
### END INIT INFO 

if [ ! -f $DIR/$EXEC ] 
then 
     echo "$DIR/$EXEC not found." 
     exit 
fi 

case "$1" in 
    start) 
     echo -n "Starting $NAME" 
     cd $LDIR 
     start-stop-daemon -d $DIR --start --background --pidfile $PID_FILE --make-pidfile --exec $EXEC --quiet 
     echo "$NAME are now running." 
     ;; 
    stop) 
     echo -n "Stopping $NAME" 
     kill -TERM `cat $PID_FILE 
     rm $PID_FILE 
     echo "$NAME." 
     ;; 
    force-reload|restart) 
     $0 stop 
     $0 start 
     ;; 
    *) 
     echo "Use: /etc/init.d/$NAME {start|stop|restart|force-reload}" 
     exit 1 
     ;; 
esac 

Trả lời

20

Màu cú pháp không cho nó đi?

stop) 
     echo -n "Stopping $NAME" 
     kill -TERM `cat $PID_FILE 

Đó là backtick và cuối dòng kill.

+12

Lỗi thậm chí đã được xác định bởi công cụ đánh dấu cú pháp Stack Overflow :) –

+0

HAH, điều đó thật thú vị, tôi không nhận thấy rằng màu cú pháp đã bị hỏng do màn hình netbook nhỏ của tôi. :) Cảm ơn. –