Полезная информация

UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 6.8 Shell Variables Chapter 6
Shell and Environment Variables
Next: 6.10 Running a Command with a Temporarily Different Environment
 

6.9 Special C Shell Variables

[Sorry, no articles about bash and tcsh variables. This book 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 (6.8) to control its own operation. These variables don't need to be put into the environment so they can be passed to subshells (38.4), because every instance of the C shell always reads the .cshrc file (2.2). 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


Previous: 6.8 Shell Variables UNIX Power ToolsNext: 6.10 Running a Command with a Temporarily Different Environment
6.8 Shell Variables Book Index6.10 Running a Command with a Temporarily Different Environment

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System