On Wed, Aug 18, 2021 at 08:50:04PM +0200, Ben Hutchings wrote: > Debian's implementation started out in 1995 or 1996 as a shell script > calling 'type', and remains a shell script.
Not very important historical note: it's true that Debian had a "which" command from 1995/1996 or so, but the current implementation doesn't descend from that at all. I wrote the earliest version of the current implementation from scratch, as part of a job I held from 2000 to 2003; in that job, I worked on lots of different Unix flavours, and we had NFS-mounted home directories so I wanted a reasonably cross-platform ~/.bashrc. The spectacular lack of consistent behaviour of "which" across those platforms got in my way, so I wrote a shell script that I could put in my ~/bin and use everywhere. I don't remember exactly when I wrote it, but it can't have been before 2000 and I think it was probably around 2002. I contributed that script to Debian in 2002 in response to https://bugs.debian.org/94507, where it became clear that the previous implementation wasn't really salvageable; Clint merged that in debianutils 1.16.5. It's been extended since then, but still has the same basic approach. -- Colin Watson (he/him) [cjwat...@debian.org]