Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
However, that link does not say where system wide path is defined in tcsh either.
My question #1 might not have clear enough, so I just rephrase.
When my tcsh starts, I have my path, (/usr/bin, /usr/local/bin....) I want to know which file defines these path. (So far, I have not found in following files, /etc/cshrc, /etc/csh.login, ~/.tcshrc and ~/login)
Aiya, it was typo. I already checked /etc/etc.cshrc (not /etc/cshrc).
So far, I have found that
1: tcsh under Solaris sets up initial path in /etc/etc.cshrc
2: login package looks like to set up path under Debian (because /etc/login.defs looks like to have initial path.) But how?
Check if your distro has an /etc/profile.d/ directory. It may contain system wide startup scripts for various types of shells.
Also from the manpage:
Startup and shutdown
A login shell begins by executing commands from the system files
/etc/csh.cshrc and /etc/csh.login. It then executes commands from
files in the user's home directory: first ~/.tcshrc (+) or, if
~/.tcshrc is not found, ~/.cshrc, then ~/.history (or the value of the
histfile shell variable), then ~/.login, and finally ~/.cshdirs (or the
value of the dirsfile shell variable) (+). The shell may read
/etc/csh.login before instead of after /etc/csh.cshrc, and ~/.login
before instead of after ~/.tcshrc or ~/.cshrc and ~/.history, if so
compiled; see the version shell variable. (+)
Non-login shells read only /etc/csh.cshrc and ~/.tcshrc or ~/.cshrc on
For examples of startup files, please consult http://tcshrc.source‐
Often a distro will have the main startup script source other scripts. It is common for there to be an .aliases script somewhere. Read through the /etc/csh.cshrc and /etc/csh.login scripts and see if any others are sourced. It is also possible that the PATH environmental variable is inherited from the system's environment when you log in. If that is the case, the paths could be set up in an /etc/profile script or even in the initrd's linuxrc or init script.
Also, different scripts may add to path. So there may not be a single place to look.