Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: BUG: Shell builtin `which` prints non-existent commands to stdout



2018-09-24 23:18:20 +0100, Stephane Chazelas:
> 2018-09-24 13:51:24 +0100, Peter Stephenson:
> > On Mon, 24 Sep 2018 14:29:33 +0200
> [...]
> > +  The original reason for this is that this behaviour is inherited
> > +  from the C shell (csh), where `tt(which)' itself orignated.  So
> > +  it has been in zsh a very long time, and it is now a feature.
> > +  (It would be possible to change this in emulation modes; however.
> > +  so far this possibility has been seen has more of an additional
> > +  confusion than a help.)
> [...]
> 
> csh had no "which" (tcsh has a which builtin), but there was a
> "which" csh script added to 3BSD 1980 that was looking up
> commands in $PATH and in the aliases defined through ~/.cshrc.
> https://github.com/dspinellis/unix-history-repo/blob/BSD-3/usr/ucb/which
[...]

Sorry, correction: "which" was added to csh in 4.4BSD (1991) and
various other BSDs that had already forked by then later (NetBSD
in 1994 for instance, and FreeBSD has switched to tcsh IIRC),
though csh on some systems like Solaris are based on older
versions and still don't have "which" builtin.

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author