哪个程序调用 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.

相关内容