`which' in csh/Ultrix 4.1

Per Hedeland per at erix.ericsson.se
Sun Mar 10 06:04:44 AEST 1991


In article <5946 at iron6.UUCP> yeates at motcid.UUCP (Tony J Yeates) writes:
>The which in tcsh & csh is faulty, causing much confusion and wasted time. 
>The tcsh people are aware of this & it sounds like they will fix it in a 
>future release.

Perhaps you could be a bit more specific about this - the only case
where I know the built-in 'which' in the current version (5.20.2) of
tcsh does the wrong thing is with "which ''builtin-or-alias" - but only
Chris Torek does such things:-). Older versions of tcsh didn't handle
"which 'builtin-or-alias'" or "which \builtin-or-alias" correctly - not
so anymore.

>I think tcsh currently uses the original csh code - so bugs, as well
>as features, were inherited.

This is pure nonsense, as the "original csh code" as far as tcsh is
concerned - i.e. that of 4.2 or 4.3 BSD csh - doesn't have a builtin
'which'! According to the tcsh manual, the builtin 'which' was added by
Rayan Zachariassen in 1984 - I don't really know if Ultrix had seen the
light of day at that time, in any case I'm confident that he didn't get
the code from Ultrix csh.

As for Ultrix csh, I don't have access to 4.1, but in 4.0, 'which' is
indeed builtin, while not documented as such. And while I wouldn't be
surprised if yet another of Ultrix' "improvements" turned out to not be
one, I can't reproduce the original poster's problems - for some
incomprehensible reason, it doesn't know about csh builtins, but at
least it pays attention to current $path and aliases, which the
non-builtin 'which' in 4.2/3 BSD does not (for more-or-less obvious
reasons).

--Per Hedeland
per at erix.ericsson.se



More information about the Comp.unix.shell mailing list