Examples of changing environment variables: C and TC shell

To change to using another printer for the current login session:

   setenv PRINTER ps2

Whenever the user prints a file, the output will be sent to the printer ps2.


To change to using another editor for the current login session and inform (export) this value to other programs which use it:

   setenv EDITOR vi

This changes the user's default editor to vi and exports this value to other programs - such as electronic mail - which make use of it.


To change to using another pager for viewing files the user adds the following lines to their .cshrc (.tcshrc) file.

   setenv PAGER less

To make this change take immediate effect enter the command:

   source $HOME/.cshrc

This causes the .cshrc file to be read, setting the variables to their new values.


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