什么-b在bash中意味着什么

Atr*_*ors 14 bash operators

我正在研究如何使用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 .


And*_*bis 6

-f - file是常规文件(不是目录或设备文件)

请查看所有文件测试操作员:http: //tldp.org/LDP/abs/html/fto.html


ask*_*tor 6

[test允许您测试某些内容的命令相同。尝试help test找出标志是什么。需要注意的是空格 -[在它之后需要一个空格。