College of Arts and Sciences

Department of Mathematics

Environment Variables and the .cshrc file

There are a number of variables associated with your UNIX session that control such things as the location to which your screen output is sent, where your print jobs are sent, the directories that UNIX looks into for commands, and so on. You may set these variables using the setenv and set commands. Some common settings are listed below.

set path = (. /usr/local             Tells UNIX to look for commands and
/usr/local/bin )                     other files in the current
                                     directory, the directory /usr/local
                                     and the directory /usr/local/bin, in
                                     that order.  This should all be one
                                     line (it just wrapped around here).

setenv DISPLAY nll304:0              Tells UNIX to send screen output to
                                     the display named nll304:0.  Your
                                     display name should appear on a
                                     sticker on your monitor.  If not,
                                     contact the helpdesk.

setenv PRINTER hpr2                  Tells UNIX to send your print jobs
                                     to hpr2, unless you specify

When you log on, the C-Shell searches the home directory for a file named .cshrc. This file contains C-Shell commands to be executed at every log on, along with informational commands often entered at login time. An example of a .cshrc should demonstrate this more clearly.

source /usr1/examples/login_example

setenv PRINTER hpr0

alias h history



The first line of this file goes to get commands from a standard .cshrc file for the Mathematics Department at WSU. The commands in the file login_example set the proper path variable, and try to adjust the keyboard according to the kind of terminal or computer you are working from, and the type of computer you are logged into. The second line sets the default printer to be hpr0 (in the basement room 3). The third allows you to type h to see your history list. The next prints the date on your screen. The last command shows you who is logged onto the machine currently.

Department of Mathematics, PO Box 643113, Neill 103, Washington State University, Pullman WA 99164-3113 Phone: 509-335-3926 Fax: 509-335-1188 Contact Us