Path: utzoo!utgpu!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: alt.sources.d Subject: Re: Multiple executables in path (Was: NON-SOURCE POSTINGS CONSIDERED HARMFUL!) Message-ID: <8833@star.cs.vu.nl> Date: 23 Jan 91 22:44:30 GMT References: <17373:Jan1908:30:3191@kramden.acf.nyu.edu> <8807@star.cs.vu.nl> <9688:Jan2313:09:4391@kramden.acf.nyu.edu> Sender: news@cs.vu.nl Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 38 In article <9688:Jan2313:09:4391@kramden.acf.nyu.edu>, brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: )[...] )> % which passwd )> /bin/passwd /usr/bin/passwd /etc/passwd )> # How odd: /etc/passwd is executable! ) )I like a which that points out non-executables in PATH, because it shows )quite clearly any wasted exec()s. I like a `which' that gives the right answer all the time, that is, the answer to the following question: When I type a command, say `foo', which file will be executed? )> % set path=($path .) )> % cp /bin/true foo )> % which foo )> # Silence. ) )It is a mistake to have . (or any other relative directories, if your )system supports them) in your path. Nonsense. It's a mistake to put `.' _before_ the standard directories. In my PATH `.' is the very last component. )> Had you read the documentation of `which5', you would have known it's not )> that trivial to get things right. ) )Different people will prefer different behaviors of ``which''; [...] Agreed. But some types of behavior are questionable at best, ridiculous at worst. -- kinnersley@kuhub.cc.ukans.edu (Bill Kinnersley): "Do phonograph turntables turn the other way in Australia?" gjh@krebs.acc.Virginia.EDU (Galen J. Hekhuis) "How do you think satanic messages were discovered on records?"