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 .
-