名稱
- Provided by: manpages-zh (Version: 1.6.3.6-1)
- Report a bug
env [選項]... [-] [名稱=值]... [命令 [引數列表]...]
在環境中將每個指定名稱的環境變數設為指定的值,並執行給定命令。
必選引數對長短選項同時適用。
單獨的“-”隱含選項 -i。如果沒有給定命令,則輸出重建後的環境。
引數中的訊號可以是類似 'PIPE' 這樣的訊號名稱,也可以是如 '1' 這樣的訊號編碼。所有已知訊號均包括其中。如需指定多個訊號,可以使用半形逗號隔開。
-S 選項可以在指令碼中指定多個引數。例如,執行一個名為 1.pl的指令碼,其第一行如下所示:
#!/usr/bin/env -S perl -w -T ...
將會執行 perl -w -T 1.pl .
如果不加 '-S' 引數,指令碼可能執行失敗並輸出以下錯誤:
/usr/bin/env: 'perl -w -T': 沒有那個檔案或目錄
請閱讀完整文件以瞭解更多細節。
This option allows setting a signal handler to its default action, which is not possible using the traditional shell trap command. The following example ensures that seq will be terminated by SIGPIPE no matter how this signal is being handled in the process invoking the command.
sh -c 'env --default-signal=PIPE seq inf | head -n1'
POSIX 的 exec(2) 手冊頁有以下內容:
由 Richard Mlynarik、David MacKenzie 和 Assaf Gordon 編寫。
GNU coreutils 的線上幫助:
<https://www.gnu.org/software/coreutils/>
請向 <https://translationproject.org/team/zh_CN.html>
報告翻譯錯誤。
請向
<https://translationproject.org/team/zh_CN.html>
報告翻譯錯誤。
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.
sigaction(2), sigprocmask(2), signal(7)
完整文件請見:
<https://www.gnu.org/software/coreutils/env>
或者在本地使用: info
'(coreutils) env invocation'
本頁面中文版由中文
man 手冊頁計劃提供。
中文 man
手冊頁計劃:https://github.com/man-pages-zh/manpages-zh