Path: utzoo!attcan!uunet!spool2.mu.edu!samsung!rex!uflorida!gatech!udel!princeton!phoenix.Princeton.EDU!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul Falstad) Newsgroups: comp.unix.shell Subject: Re: Dot in PATH? Message-ID: <5738@idunno.Princeton.EDU> Date: 28 Jan 91 01:53:26 GMT References: <1991Jan24.221552.5906@bradley.bradley.edu> <5528@auspex.auspex.com> <1991Jan28.003846.25111@bradley.bradley.edu> Sender: news@idunno.Princeton.EDU Distribution: comp Organization: The E. Henry Thripshaw Fan Club Lines: 44 data@buhub (Mark Hall) wrote: >In <5528@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >> You thought incorrectly; UNIX shells, and the "exec[lv]p()" routines, >> check only if "." is in the current command search path. > >Well, let me show you something: > >in my .profile is this path command: > >> PATH=:/usr/lbin:/usr/local/bin:/bin:/usr/bin:$HOME:$HOME/BIN:$HOME/USR:/usr/tmp:/tmp:/tmp/talk: > >if I run a program in the current directory (and it's not in my path command) >my shell looks in the current directory FIRST. This is also the way MS-DOS >works, but that's a different notes-group. This is why I made the original >comment. I grant that other shells may not work this way (I'm not saying that >they have to be alike), but my shell DOES treat my commands this way. >BTW: I'm running UNIX SYSTEM V v3.2(i think) Most if not all shells do work this way. Look at your PATH again: PATH=:/usr/lbin:/usr/local/bin:/bin:/usr/bin:$HOME:$HOME/BIN:$HOME/USR:/usr/tmp:/tmp:/tmp/talk: In path strings, a null component is synonymous with ".". You have . twice in your path, actually: once at the beginning and once at the end. More explicitly, your path is equivalent to: PATH=.:/usr/lbin:/usr/local/bin:/bin:/usr/bin:$HOME:$HOME/BIN:$HOME/USR:/usr/tmp:/tmp:/tmp/talk:. I would change your PATH to: PATH=/usr/lbin:/usr/local/bin:/bin:/usr/bin:$HOME:$HOME/BIN:$HOME/USR or at the very least: PATH=/usr/lbin:/usr/local/bin:/bin:/usr/bin:$HOME:$HOME/BIN:$HOME/USR:. Now that you've posted to the net the fact that you have /tmp in your path, we don't want people creating trojan horses named /tmp/mroe, now do we? ;-) -- Paul Falstad, pfalstad@phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD "And she's always on about men following her. I don't know what she thinks they're going to do to her. Vomit on her, Basil, says."-Flowery Twats