加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-15 18:26:18 所属栏目:安全 来源:网络整理
导读:我在看如何使用 runit to run gunicorn.我正在查看bash文件,我不知道-f $PID在做什么 #!/bin/shGUNICORN=/usr/local/bin/gunicornROOT=/path/to/projectPID=/var/run/gunicorn.pidAPP=main:applicationif [ -f $PID ]; then rm $PID; ficd $ROOTexec $GUNICO
我在看如何使用 runit to run 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

谷歌在这种情况下毫无用处,因为搜索标志是没用的

Google is useless in this case because searching for flags is useless

幸运的是,Bash参考手册可以在线获取,时间是http://www.gnu.org/software/bash/manual/bashref.html.这是谷歌第一次使用“Bash手册”. §6.4 “Bash Conditional Expressions”说:

-f file

True if file exists and is a regular file.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读