為什么我不論以什么用戶登錄上去(即使不是root,實用user1登錄)
每次會執行/root/.bash_profile
而不是執行/home/user1/.bash_profile呢?
這兩個文件都是存在的。
我分別在/root和/home目錄下的.bash_profile文件中加了echo和env兩個shell命令
看到的答應的echo是/root目錄下的.bash_profile,而home下的.bash_profile中的echo沒有答應。
我知道原因了。
因為執行getty的時候,講調用getty的進程的環境變量帶入了。
在linux上實用login
不要-p就可以了。