[Chapter 6] 6.5 PATH and path
Author: Jerry Peek, Tim O'Reilly & Mike Loukides
Date: 1998-10-23T15:38:03Z

#

| Chapter 6 Shell and Environment Variables |

## 6.5 PATH and path

For the C shell, it's slightly incorrect to say that PATH contains the search list for commands. It's a bit more complicated. The PATH environment variable is used to set the path shell variable; that is, whenever you setenv PATH (6.4), the C shell modifies path accordingly. For example:

>     setenv PATH /bin:/usr/bin:/usr/local::$HOME/bin

In PATH, an empty entry (`::`) stands for the current directory. The C shell's path shell variable (6.8, 6.9) is the actual search list. Its syntax is slightly different; the list of directories is enclosed in parentheses (47.5), and the directories are separated by spaces. For example:

    ~
    set path=(/bin /usr/bin /usr/local . ~/bin)

If you set the path shell variable, the C shell will automatically set the PATH environment variable. You don't need to set both. Many people use a set path command instead of setenv PATH.

- ML

6.4 The PATH Environment Variable |  | 6.6 The TZ Environment Variable