如何自動啟動我的 bash_profile?

如何自動啟動我的 bash_profile?

當我打開新終端時,它不會執行自動啟動我的 bash_profile。我需要做「source .bash_profile」。

當我使用 Screen 時,這種情況又發生了。

答案1

只有當您將 bash 作為登入 shell 呼叫時才會載入 ~/.bash_profile 文件,否則載入 ~/.bashrc

我的意思是,如果您在 X Window 中開啟終端,則可能會作為非登入 shell 被呼叫。許多 X 終端模擬器都有一個選項,可以在每次開啟視窗或選項卡時配置為登入 shell。

相關內容