Subject: Re: PR's about which(1)
To: NetBSD-current Discussion List <current-users@NetBSD.org>
From: Steven M. Bellovin <firstname.lastname@example.org>
Date: 04/04/2004 15:14:28
In message <m1BACM2-0002URC@proven.weird.com>, "Greg A. Woods" writes:
>[ On Saturday, April 3, 2004 at 12:19:09 (-0800), Erik E. Fair wrote: ]
>> Subject: Re: PR's about which(1)
>> At 14:42 -0500 4/3/04, Greg A. Woods wrote:
>> >I don't think so. Solaris has a "which" script because their version of
>> >"csh" is ancient (i.e. isn't actually "tcsh") and, IIRC, it doesn't have
>> >a built-in of the same name like "tcsh" does.
>> tcsh is not csh. tcsh is a broken csh.
>Indeed. I mentioned tcsh simply because it is where, IIUC, the idea of
>having "which" as a built-in originated (I don't know if the
>4.4BSD-Lite2 implementation of dowhich() is the same as the one in tcsh).
I suspect that 'which' has to be a built-in -- if you don't export
$PATH, a command version will see a different set of directories than
the shell will. Besides, there are aliases, shell functions, and other
shell built-ins; an outboard command won't ("can't" is more accurate)
know about these.
--Steve Bellovin, http://www.research.att.com/~smb