On Wed, Aug 18, 2021 at 08:50:04PM +0200, Ben Hutchings wrote: > 3BSD first implemented 'which': > <https://minnie.tuhs.org/cgi-bin/utree.pl?file=3BSD/usr/man/man1/which.1> > (1979). This was csh-specific and I think it later became built-into > csh. > > FreeBSD 2.1 introduced a new non-built-in implementation: > <https://www.freebsd.org/cgi/man.cgi?query=which&apropos=0&sektion=0&manpath=FreeBSD+2.1.0-RELEASE&arch=default&format=html> > (1995). This was written in Perl and then rewritten in C a few years > later. > > Debian's implementation started out in 1995 or 1996 as a shell script > calling 'type', and remains a shell script. > > Red Hat has yet another implementation: > <https://www.freebsd.org/cgi/man.cgi?query=which&apropos=0&sektion=0&manpath=CentOS+7.1&arch=default&format=html>, > <https://carlowood.github.io/which/> (1999 or earlier). This is > written in C. > > So 'which' has a very long history in csh, which was the default > interactive shell in many versions of Unix. Its availability to other > shells dates back to the 90s (at least) but is not portable due to > there being multiple very different implementations.
I'm happy to transition /usr/bin/which to alternatives if people are interested in packaging all of these.