$path vs $PATH

Jordan K. Hubbard jordan at greipa.UUCP
Fri Jun 7 03:33:33 AEST 1985


In article <183 at luke.UUCP> sml at luke.UUCP (Steven List @ Uncle Bene's Farm) writes:
>> Okay, UNIX gurus, can somebody tell me about the differences
>> (in csh) between the shell variable $path and the environment
>> variable $PATH ???
>
>PATH sets the directory search path for the bourne shell.
>path sets the directory search path for the C shell.
>
>To check it out,
>
>	in the bourne shell, type PATH=""; export path
>	  then try to execute anything
>	in the C shell, type unset path
>	  then try to execute anything
>	then reverse them

Uh, Steve, you've forgotten one thing.. In the bourne shell, the
path variable is called PATH. That is true. There's also a very
significant 'path' variable in csh. Also true. But if you'll
re-read the question, I think you'll see that his question was
why there were TWO path variables in csh. PATH and path..

Well, 'PATH' is set when 'path' is in csh (someone pointed that
out I belive) and vice-versa (yes, setenv'ing PATH will set path)

Why?  Well, there are certain cases where user programs will
want to do a getenv on 'PATH' to search for programs (like
the 'which' command). Also, the execlp and execvp calls
need to look at it.
-- 
			Jordan K. Hubbard
			@ Genstar Rental Electronics.
			Palo Alto, CA.
			{pesnta, decwrl, dual, pyramid}!greipa!jordan

			"Ack ack!".

				- William the feline



More information about the Comp.unix mailing list