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

Maarten Litmaath maart at cs.vu.nl
Tue Jan 22 10:01:58 AEST 1991


In article <17373:Jan1908:30:3191 at kramden.acf.nyu.edu>,
	brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
)Hmmm. I've always been satisfied with the speed of

[_Excessively_ long line split.]

)  alias which 'echo `echo "$PATH" | tr : '\''\012'\'\
)  ' | sed -e '\''s+$+/\!:1+'\'' -e '\''s:^:/.[.]:'\'\
)  '` | sed '\''s:/../:/:g'\'''

This alias doesn't deal with aliases (easily fixed), but most importantly
it _fails_.  Two examples:

	% which passwd
	/bin/passwd /usr/bin/passwd /etc/passwd

	# How odd: /etc/passwd is executable!

	% set path=($path .)
	% cp /bin/true foo
	% which foo


	# Silence.

Had you read the documentation of `which5', you would have known it's not
that trivial to get things right.
--
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