Previous Topic: Shell Initialization FilesNext Topic: Korn Shell Initialization Files


C Shell Initialization Files

When you log in to the C shell, it automatically runs a number of files. The first file run is a system file named /etc/.login, which contains system-wide configuration information (such as your default path). After these files are run, the C shell reads and runs the commands from the following files in your home directory:

.cshrc

Establishes variables and operands that are local to a specific shell. Each time you create a new shell, the C shell reinitializes these variables for the new shell.

The following is a sample .cshrc file:

set noclobber
set ignoreeof
set path = (~/bin $path /usr/games)
alias h history
.login

Contains commands that you want to run once at the beginning of each session. If the C shell is running as a login shell, it reads and runs the commands in the .login file in your home directory after login.

The following is a sample .login file:

setenv history 20
setenv MAIL /usr/spool/mail/$user
.logout

Runs when you exit from your login shell.