哪個程式調用 csh.cshrc?

哪個程式調用 csh.cshrc?

據我所知,當使用者遠端登入unix時,首先啟動一個getty進程。如果身份驗證成功,則呼叫 etc/environment。但是,我不明白在此過程中何時調用 csh.cshrc 和 csh.login ?

答案1

csh.cshrc和是和(或)csh.login的全域版本,例如 csh 的設定檔。執行 csh 時,它會讀取和(它也會讀取兩個 cshlogin 檔案)。當使用者的主目錄中沒有.csh 時,csh 只能讀取.之所以如此,是因為 root(或具有正確 sudo 權限的人)可以設置為包含基本設置,並且每個用戶都可以在.~/.cshrc~/.login~/.csh_login/etc/csh.cshrc~/.cshrc~/.cshrc/etc/csh.cshrc/etc/csh.cshrc~/.cshrc

答案2

man csh

  An instance of csh begins by executing commands from the file
 /etc/csh.cshrc and, if this is a login shell, /etc/csh.login.  It then
 executes commands from .cshrc in the home directory of the invoker, and,
 if this is a login shell, the file .login in the same location.  It is
 typical for users on CRTs to put the command stty crt in their .login
 file, and to also invoke tset(1) there.

相關內容