Subject: Re: CVS commit: src/usr.bin
To: Perry E. Metzger <perry@piermont.com>
From: Jim Wise <jwise@draga.com>
List: source-changes
Date: 04/01/2004 15:46:56
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 1 Apr 2004, Perry E. Metzger wrote:

>
>Bill Studenmund <wrstuden@netbsd.org> writes:
>> So the decision was that it would be better to remove this command rather
>> than leave it in in such a broken form.
>
>Solaris has which.
>All versions of linux I've just checked have which
>FreeBSD has which
>OpenBSD has which
>
>So, to a good approximation, we are now the only Unix without the
>command.

We provide `which' as a shell built in for the only shell for which it's
output has any useful meaning.  If you want similar behavior for another
shell, _surely_ you will not find it very hard to alias that shell's
equivalent command (i.e. `type' in sh, ksh, or bash) to which, now will
you?

At any rate, an external `which' which tells a user what command would
be found by a shell which they are definitionally not using (as they
didn't get the builtin) is of _extremely_ limited usefulness, and
violates the principal of least surprise in _any_ case.

And if you believe that an external program which necessarily cannot
know about aliases, shell functions, and similar cases is something you
simply must have, well, whereis is in /usr/bin, and is implemented in c.

You can always alias that to `which' if you find that `type' is giving
you the correct answer too much of the time...

- -- 
				Jim Wise
				jwise@draga.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)

iD4DBQFAbH/ERxzMSZ/9vAMRAuEnAJdG5A/YIs5VFSLZX+Ao316qlTnaAJ4iZ2+m
lcjBWX9qyKu7Jpd/O+xFEw==
=xZ6B
-----END PGP SIGNATURE-----