Special C Shell Variables

[Sorry, no articles about bash and tcsh variables. This tutorial focuses on the "base" shells, sh and csh. csh variables work in tcsh, and many work (in slightly different forms) with bash too. For a complete list, check your bash or tcsh manpage. -JP]

The C shell recognizes and uses environment variables, but it also uses a great many simple shell variables () to control its own operation. These variables don't need to be put into the environment so they can be passed to subshells (), because every instance of the C shell always reads the cshrc file (). Simple shell variables set there are thus propagated to every C shell.

Many of the special C shell variables are simply used as flags; that is, they need not be set to any particular value. The shell simply tests whether they exist or not. They are set simply by saying:

set variable

rather than:

set variable=value

Here are some of the special variable names used by the C shell:

- JP, TOR