Environment Variables

The shell lets you define a variable and assign a value to it. Many programs take advantage of this ability. For example, many programs that start up a text editor (such as "vi" or "emacs") look at the variable EDITOR to see which editor you wish to use. These variables are usually set in the '.login' or '.cshrc' files.

Here are some different ways of setting environment variables:

The shell also defines some variables for you such as HOME, which is your home directory, and PATH, which is the list of directories searched for executable files. The "man" pages for various programs will tell you which environment variables they use.

Click here to go to the next section.

Or click here to go to the top of the chapter.