This section covers the minimum you will need to know to customise your UNIX environment, specifically the C Shell ( csh). For more information we recommend you mean the csh manual page (type man csh). The chapter Getting to Know Your Shell contains lots more information about customising your shell, in somewhat heavier detail.
There will be a file called .cshrc in your home directory. (If there isn't, talk to the interface room.) If you looked through it with less, like so
charlie:~ :1 > less .cshrc
You'd see a list of commands, which are probably unfamiliar.
This part of TFM asks you to change your .cshrc. Because .cshrc determines where UNIX looks for commands like ls (as well as other, equally important things it would be annoying to break), it would be wise to make a backup copy before changing the file, like so
charlie:~ :1 > cp .cshrc .cshrc.orig
If something terrible happens
you can restore your original with:
charlie:~ :1 > /bin/mv -f ~/.cshrc.orig ~/.cshrc
You can edit your .cshrc using Vi. If you only want to append a new command to the file, you can also use cat >> (type ^d when you're finish adding things).
charlie:~ :2 > cat >> .cshrc cookie ^D charlie:~ :3 >
This adds cookie to the end of your .cshrc; cookie is a program for printing small gem of wisdom and wit; you now get one each time you log in.
Note: changes to your .cshrc have no affect until you log in
again, or pretend you've done so by executing
csh.
charlie:~ :2 > exec csh
Many programs use Environment Variables to allow you to customise them. In fact, much of the behaviour of csh is determined by the way they are set. You can list the values of all environment variables with the env command. You can print the value of a specific environment variable by using echo. The following will print the value of the PATH variable.
charlie:~ :2 > echo $PATH
PATH is a colon seperated list of directories that should be searched to find commands. You should only ever want to add additional direcories to PATH. The following will add a directory called bin in your home directory to the list.
charlie:~ :2 > setenv PATH ${PATH}:~/bin
If you put executable commands, like useful shell scripts or programs you have compiled, in bin, csh can now find them without being given their full path name. There are examples of adding to PATH in the default .cshrc.
One environment variable that people seem to take much joy in changing is
prompt, because it determines what the prompt looks like, and
consequently affecting some sort of self congratulatory aura
.
charlie:~ :2 > set prompt="You're Ugly > "
The variable TERM specifies your terminal type. If you're using a workstation it's value will probably be xterm. If you're using a PC in the Solarium it will probably be network. When you log into banksia, you'll be asked for your terminal type; if you get it wrong, you can change it with setenv TERM. For example, to change to a vt100 terminal type
charlie:~ :3 > setenv TERM vt100
Any of those commands can also be put in your .cshrc file, to save
typing. (For instance, you can have your prompt automatically set by
.cshrc.
)
Aliases let you abbreviate commands, and in a vague sense introduce new ones. The following creates a command called splat.
charlie:~ :4 > alias splat echo "Thud crunch bang" charlie:~ :5 > splat Thud crunch bang
There are a couple of aliases already in .cshrc.
This document was generated using the LaTeX2HTML translator Version 95.1 (Fri Jan 20 1995) Copyright © 1993, 1994, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html cshrc.tex.
The translation was initiated by Piers Edmund Johnson on Mon Apr 1 20:53:59 EST 1996