這是我的代碼,我不完全理解。我將衷心感謝您的幫助
#!/bin/sh
set -e
envsubst < /etc/nginx/default.conf.tpl > /etc/nginx/conf.d/default.conf
nginx -g 'daemon off;'
uj5u.com熱心網友回復:
這不是 Nginx 的東西,而是 Unix shell 的東西,set命令。set -e方法:
當此選項打開時,如果簡單命令由于 Shell 錯誤的后果中列出的任何原因而失敗或回傳退出狀態值 >0,并且在一段時間、直到或 if 關鍵字之后不屬于復合串列的一部分,并且不是 AND 或 OR 串列的一部分,也不是前面有 ! 的管道 保留字,則shell應立即退出。
uj5u.com熱心網友回復:
這是標志,sh你可以看看man sh它的描述
-e errexit If not interactive, exit immediately if any
untested command fails. The exit status of a com‐
mand is considered to be explicitly tested if the
command is used to control an if, elif, while, or
until; or if the command is the left hand operand
of an “&&” or “||” operator.
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/416878.html
標籤:
