linux下命令行的參數(shù)可能會很長,特別是在編譯安裝的時configure的參數(shù)。
如果直接寫在一行,書寫起來會很長,既不不美觀也容易發(fā)生錯誤。
那如何將一行命令拆成多行去執(zhí)行呢? 此時可使用續(xù)行符“\”,將一行命令分解成多行。
shell命令中反斜線有兩種含義:
1.對有特殊含義的字符進行轉(zhuǎn)義
echo "escape\$"
escape$
2.\+Enter,反斜線后接回車,表示當前行的續(xù)行
./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