2011年1月24日 星期一

Difference between .bash_profile and .bashrc Files

以下內容是從這裏節錄出來的:

.bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.

就是說,當你使用 login console 或用 ssh login 時, .bash_profile 會被調用。
如果只是在 GNOME, KDE 或 emacs 裏面,打開一個 shell command 時, .bashrc 會被調用。

那麼作 global 設定時,就是這兩種情形分別對應到 /etc/profile /etc/bash.bashrc 啦!
其中,若是需要在 login 時,也希望 bashrc 被調用,就可以在 profile 裏面 source bashrc.

沒有留言:

張貼留言