ronbe@tekred.UUCP (Little Guy) (05/28/85)
Okay, UNIX gurus, can somebody tell me about the differences (in csh) between the shell variable $path and the environment variable $PATH ??? -- New dictionary entries: recursion: see recursive recursive: see recursion ...tektronix!tekred!ronbe (Ron Bemis)
frodo@wcom.UUCP (Jim Scardelis) (06/01/85)
> Okay, UNIX gurus, can somebody tell me about the differences > (in csh) between the shell variable $path and the environment > variable $PATH ??? > ...tektronix!tekred!ronbe (Ron Bemis) My understanding is that only the format of the two variables is different, with both containing the same information, because csh automatically sets $PATH when you set $path. (At least my Xenix 3.0 manual seems to say so....) Jim Scardelis -- uucp: {vax135|ihnp4}!timeinc!wcom!frodo ARPA: 1891@NJIT-EIES.MAILNET@MIT-MULTICS.ARPA "The opinions expressed herein are those of my computer, and not necessarily those of myself, Warner Computer Systems, or any other computer or company along the line. "
sml@luke.UUCP (Steven List @ Uncle Bene's Farm) (06/03/85)
> 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 /-\ :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-: : Steven List @ Benetics Corporation : : (415) 940-6300 : : {cdp,idi,oliveb,tolerant}!bene!luke!steven : :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-: \-/
jordan@greipa.UUCP (Jordan K. Hubbard) (06/06/85)
In article <183@luke.UUCP> sml@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
rwl@uvacs.UUCP (Ray Lubinsky) (06/07/85)
> > Okay, UNIX gurus, can somebody tell me about the differences > > (in csh) between the shell variable $path and the environment > > variable $PATH ??? > > ...tektronix!tekred!ronbe (Ron Bemis) > > My understanding is that only the format of the two variables > is different, with both containing the same information, because > csh automatically sets $PATH when you set $path. > Furthermore, csh(1) automatically sets $path when you perform the command "setenv $PATH". As far as I can see, the major difference between $PATH and $path is that the latter is really only a part of your csh(1) operating environment. $PATH is the variable that is understood inside of all programs, being imported through the environment pointer and available through the getenv(3) call. -- Ray Lubinsky University of Virginia, Dept. of Computer Science uucp: decvax!mcnc!ncsu!uvacs!rwl
chris@umcp-cs.UUCP (Chris Torek) (06/10/85)
> Furthermore, csh(1) automatically sets $path when you perform the > command "setenv $PATH". Actually, you said that exactly backwards (though the rest of your text shows that you know what's really going on). Csh automagically exports the variables ``path'' and ``term'' (doing the appropriate translations). What I've never quite been able to figure out is why it does path=>PATH and term=>TERM but not PATH=>path and TERM=>term... (after startup that is). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland