Multiple executables in path (Was: NON-SOURCE POSTINGS CONSIDERED HARMFUL!)

Maarten Litmaath maart at cs.vu.nl
Thu Jan 24 09:44:30 AEST 1991


In article <9688:Jan2313:09:4391 at kramden.acf.nyu.edu>,
	brnstnd at 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 at kuhub.cc.ukans.edu (Bill Kinnersley):
	"Do phonograph turntables turn the other way in Australia?"
gjh at krebs.acc.Virginia.EDU (Galen J. Hekhuis)
	"How do you think satanic messages were discovered on records?"



More information about the Alt.sources.d mailing list