The C Shell

Getting Started

First you'll have to ask your system administrator to add you to the system. You will get an username and a password for this dedicated system.

When you start your terminal to get into the UNIX system, you will get a message like

login:

You have to respond with your username and then you will be prompted for your password.

After you have typed your password too, you might get a greeting, a message of the day or some data about the system.

After that you should either see $ or %, the Bourne shell or C shell prompt respectively.

If you see $, ask your system administrator to change your account to use C shell as default; in the meantime type - do not forget to end each command line with (<Return>), or (<Enter>):

$ csh

%

to execute the C shell.

After your first login: Do not forget to change your password!
(But be sure you will remember it later on!)

To leave the C shell type CRTL-d or if you have set ignoreeof type logout.

Setting Up Your Terminal

Now try to use your <Delete>-key (or the <Backspace>-key respectively); if it does not work properly, type

% stty erase <Delete> (the <Delete>-key, not the word Delete)

To see the rest of the terminal settings, type

% stty -a

look for intr; if intr is not set to ^c, type

% stty intr <CTRL>-c

To set up the terminal for the vi editor set the UNIX environment variable TERM to your terminal; In most cases your terminal will be compatible to a VT100 terminal - so type

% setenv TERM vt100

Window Sessions

If you want to start a window session (many applications have window based interfaces like X or Motif), you have to set your DISPLAY-variable to your lokal terminal:

% setenv DISPLAY terminal-name:0.0

or

% setenv DISPLAY IP-address:0.0

You can get your terminal-name or your IP-address respectively by

If it does not work: ask your system administrator!

If you are using a PC as terminal and you want to run X applications under UNIX, you have to start Xstart: The Xstart-Window should look like

or you can use the telnet-window:

Special Files

You can avoid to type the previous commands every time you login by writing these lines into your .login file in your home directory (~). For using the vi editor see the last section of this document.
The C shell will read these files when you login (first .cshrc then .login), .cshrc will be read every time a new shell is invoked.

Another very important file in your home directory is the .cshrc file, which is read from the C shell (in theory) before the .login file and every time a new shell is started (a new shell is started when you execute a shell script or when you type csh); Here you can change your prompt, define your history list and place your aliases.

Special Files
FileMeaning
/etc/cshrc C shell executes commands in current shell at login before ~/.cshrc
~/.cshrc C shell executes commands in current shell during C shell startup
/etc/.login C shell executes commands in current shell at login before ~/.login
~/.login C shell executes commands in current shell during login after .cshrc
~/.logout C shell executes commands in current shell during logout
/etc/profile Bourne shell executes these commands in current shell at login before ~/.profile
~/.profile Bourne shell executes commands in current shell during Bourne shell startup

Example: The lines


   set prompt = $user " > "
   set history = 10
   alias h history
   alias dir ls -l 
  
in your ~/.cshrc file will change your prompt to your user name, followed by " > ", tells the C shell to save 10 commands (so the command history will display a list of the last 10 commands), defines h to become an abbreviation for the history command, and enables you to use dir to get the list of files (and directories) within the given directory (default is cwd).

To make this commands available to you immediately you have to type

% source .cshrc

otherwise they will be available the next time you login.