我的脚本想自动获取 nginx.conf 位置。
如:运行脚本返回:
/usr/local/nginx/conf/nginx.conf
通过nginx -t获得
nginx -t
nginx=`nginx -t 2>&1 | grep configuration` if [ ! -z "$nginx" ];then nginxtmp="${nginx#*file}" nginxf="${nginxtmp%test*}" echo $nginxf fi
548k questions
547k answers
4 comments
86.3k users