我正在研究如何使用runit运行gunicorn.我正在查看bash文件,我不知道-f $PID它在做什么
#!/bin/sh
GUNICORN=/usr/local/bin/gunicorn
ROOT=/path/to/project
PID=/var/run/gunicorn.pid
APP=main:application
if [ -f $PID ]; then rm $PID; fi
cd $ROOT
exec $GUNICORN -c $ROOT/gunicorn.conf.py --pid=$PID $APP
Run Code Online (Sandbox Code Playgroud)
在这种情况下谷歌是没用的,因为搜索标志是没用的
rua*_*akh 21
在这种情况下谷歌是没用的,因为搜索标志是没用的
幸运的是,Bash参考手册可在线获取,网址为http://www.gnu.org/software/bash/manual/bashref.html.这是Google推出"Bash手册"时的首次亮相.§6.4"Bash条件表达式"说:
-f file如果文件存在且为常规文件,则为True .