這個問題在這里已經有了答案: shell 命令以點開頭是什么意思? (1 個回答) unix 命令列使用 . (點)與沒有 (5 個回答) 13 小時前關閉。
如 bash_profile 檔案中所示:
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
我問到第二行,這到底是做什么的?
uj5u.com熱心網友回復:
點是source命令的快捷方式。基本上,它在當前環境中包含一個檔案。您可以使用它從不同的 shell 腳本執行通用命令,或設定環境變數(但僅限于當前 shell 的范圍內;而不是父 shell)。
這就是source --help給你的:
source: source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/363390.html
上一篇:如何遞回地將FormData轉換為JSON(保留層次結構)?
下一篇:將大量JSON檔案合并為一個
