linux下命令行的参数可能会很长,特别是在编译安装的时configure的参数。
如果直接写在一行,书写起来会很长,既不不美观也容易发生错误。
那如何将一行命令拆成多行去执行呢? 此时可使用续行符“\”,将一行命令分解成多行。
shell命令中反斜线有两种含义:
1.对有特殊含义的字符进行转义
echo "escape\$"
escape$
2.\+Enter,反斜线后接回车,表示当前行的续行
./configure --sbin-path=/usr/local/nginx/nginx \
--conf-path=/usr/local/nginx/nginx.conf \
--pid-path=/usr/local/nginx/nginx.pid \
--with-http_ssl_module \
--with-pcre=/usr/local/src/pcre-8.21 \
--with-zlib=/usr/local/src/zlib-1.2.8 \
--with-openssl=/usr/local/src/openssl-1.0.1c
网友评论