Subject: Re: bin/10611: /usr/bin/which reads user's .chsrc even if user's shell is not csh
To: None <>
From: Chris G. Demetriou <>
List: netbsd-bugs
Date: 07/16/2000 19:30:00 writes:
> /usr/bin/which is a csh script. It does read ~/.cshrc. If .cshrc is
> buggy, the user will get strange behavior. This is espacially a problem
> if the user does not use csh: she will never notice that the problem
> comes from .cshrc
> >How-To-Repeat:
> Be a ksh user. Create a buggy .cshrc (bad commands for instance), try to
> run which, you get an error

This is the correct, documented, and historical behaviour for the
'which' script.

Yes, if you're not a csh user it may seem less than optimal... but
it's the way that which has always worked, and changing it will cause
serious problems for people who have gotten used to using it.  (in
particular, if it doesn't source the user's cshrc, it can't
necessarily figure out aliases, etc.)

the ksh equivalent is a shell builtin, 'whence'.