C Shell: Tip...

If a shell and an environment variable have the same name, the value of the local shell variable will be used. You can avoid problems by making sure that shell and environment variables with the same name are set to the same value in your .cshrc (.tcshrc).

For example, suppose you set the following variables in this order in your .cshrc (.tcshrc) file:

   setenv TERM vt100
   ...
   ...
   set term=xterm

When a shell is invoked, the value of the environment variable TERM is copied into the shell variable term. But the value of this shell variable is set later on in the .cshrc (.tcshrc) file, and it is this value which is then copied back into the environment value TERM which is then exported to the general environment.


[Home] [Search] [Index] This site maintained by unixhelp@ed.ac.uk