next up previous contents
Next: Shell Commands Up: Unix C Shell Interface Previous: Unix C Shell Interface

C Shell Initialization Files

When you log in to the system, a series of initialization files are used to set up the environment in the desired way. The three primary initialization files are the .login , the .cshrc , and the .xsession .

The .login file is used to set global environment variables such as terminal type and is executed only once during the login process. .login is called ONLY when logging in via a terminal device (non X windows device).

The .cshrc is the C-shell initialization; it is executed every time a C-shell is created. Typically, the .cshrc declares directory paths, aliases, default protection modes (via umask), and any other environment variables that affect the operation of the shell.

The .xsession file is used to set up your initial screen under X-windows on the Sun's. Programs to run, window placement, size, and color is specified in .xsession before the last line of the file, which calls the window manager (twm). The last command executed from your .xsession must always be twm.

Be careful about modifying your .xsession and .cshrc files. If you change something such that their execution causes an error message, your keyboard lights will flash and you will be logged out. If this happens then you must correct the faulty .xsession file by telneting in from a PC or after typing your password hit the F1 key instead of <enter> to bypass your .xsession and .cshrc files and just open an xterm for you.

Put Xwindow programs that you want to run on startup into your .xsession file, NOT your .cshrc file. This is becase your cshrc file is run even if your are telneting in from a PC, and you can't display an Xwindow application on a terminal!!

Note that the initialization files in your directory may be redirected to an initialization file in another directory. For example, your .login file should contain the line:

source /usr/local/lib/UMCS.login

This will execute the commands in the /usr/local/lib/UMCS.login file. If you wish to tailor your .login, do so after the source statement!


next up previous contents
Next: Shell Commands Up: Unix C Shell Interface Previous: Unix C Shell Interface
World Wide Web Administrator
1/5/1999