tcsh

      The tcsh shell is a superset of the csh shell.  It was desgned to add more functionality to csh.  As a superset, it has many of the same features as csh
.cshrc File       The .cshrc file is run every time you start tcsh, whether you open a new terminal window, run a shell script or just type csh at the prompt. The .cshrc file should hold commands and definitions that you ALWAYS want to run. There is also the possibility of using a .tcshrc file, but using the .cshrc file will work in lieu of a .tcshrc file.
.login File       The .login file is run for each login tc-Shell you run. A login shell is exactly the same as a regular shell except that the login shell executes the .login file. Usually when you log in, the first shell that is run is a login shell, and subsequent ones (i.e., any run because of shell scripts) are non-login shells. However, each terminal window you open in X under the default EWS setup on the workstations runs as a login shell. 

      Thus, The .login file should contain commands and definitions that you want run ONLY when you log in, for example, setting the terminal type. 

You are provided a default .login file on your EWS account.
 

Path       When you are issued your account, the .cshrc file contains only one executed line, which is: 

source /usr/local/ews/system.cshrc 

      This line calls the file /usr/local/ews/system.cshrc and runs it. This file contains a few environment settings and commands to set up your working environment. Note that this file is not the same throughout all machines in the EWS labs--each type of system (i.e., Sun, HP) has its own /usr/local/ews/system.cshrc, so if you log into a Sun, you do not run the same file as when you log into an HP. These different files allow us to account for minor differences in the various operating systems. 

Modification  ****** NOTE : If you modify the .cshrc file, you must be careful to take into account differences between the different systems. Failure to do so can result in problems using a particular type of system. ****** 

      In other words, do not place HP-specific commands in your .cshrc file, for if you ever log into a Sun system, you may find that the command either does not work at all or does not have the same effect (or, even worse, has a destructive effect). 

      To account for these differences, the /usr/local/ews/system.cshrc file defines an environment variable called ENVIRON to be the identity of the system you are on. It can take values of SUN, or HPUX, depending on which platform you are using. 

****** NOTE : YOU MUST LEAVE THE LINE source /usr/local/ews/system.cshrc IN YOUR .cshrc FILE FOR THE ENVIRON VARIABLE TO BE DEFINED.****** 

Example
.cshrc File
      Here's an example of a modified .cshrc file. In this file, the user wishes to make changes to his path and create a few aliases, but because of differences in machines, he must take into account which machine he is logging into. 

#Sample .cshrc file 
#
#DON'T REMOVE THIS NEXT LINE! 
source /usr/local/ews/system.cshrc 

#Now that we've done the system-specific stuff, we can 
#add our own commands. 

#If we're on a Sun system, we want to define plist to give a
#full process list. 

if ($ENVIRON == SUN) then 
alias plist "ps -aux" 
endif 

#If we're on an HP, we want to be able to use JDK 
#and define plist as for the Suns. 

if ($ENVIRON == HPUX) then 
set path=($path /usr/local/bin) 
alias plist "ps -ef" 
endif 

#OK, we're all done! 

 
Warning
  • Remember to be careful in editting your start-up files.  If you make harmful changes, you might not be able to log in next time.
  • Use the command "getskel" to retrieve copies of the original startup files.  This command will also save backup copies of your current startup file in your home directory.  (full path of getskel is /usr/local/ews/getskel)
Features Features of tcsh:
  • can cycle through previous commands with the up and down arrows.
  • can use the TAB key for filename completion.  Instead of typing out long filenames, type the first few letters and hit TAB.


For more information on UNIX Shells one can look at:

Back to the table of contents