bash 语法错误:反引号替换中的 EOF
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5837125/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 20:28:43 来源:igfitidea点击:
Syntax error: EOF in backquote substitution
提问by Kit Sunde
I'm getting an error Syntax error: EOF in backquote substitution
and I don't have the faintest idea why. Would anyone mind taking a quick look?
我收到一个错误Syntax error: EOF in backquote substitution
,我不知道为什么。有人介意快速浏览一下吗?
#! /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 "" 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)
stop)
echo -n "Stopping $NAME"
kill -TERM `cat $PID_FILE
stop
##代码## start
;;
*)
echo "Use: /etc/init.d/$NAME {start|stop|restart|force-reload}"
exit 1
;;
esac
回答by eduffy
The syntax coloring didn't give it away?
语法着色没有放弃它?
##代码##It's the backtick and the end of the kill
line.
这是反引号和kill
行尾。