Subject: Re: bin/10611: /usr/bin/which reads user's .chsrc even if user's shell is not csh
To: =?iso-8859-1?Q?Jarom=EDr_Dole=E8ek?= <>
From: Andrew Brown <>
List: tech-userlevel
Date: 07/19/2000 14:21:53
>I'd like to change it to be alias for whereis(1), with appropriate
>notes in manpage, mentioning historic implementation, the change and
>csh which builtin.
>Opinions ?

where(1) says:

     The path searched is the string returned by the sysctl(8) utility for the
     ``user.cs_path'' string.

which is...sub-optimal.  imho, which(1) should be a small binary that
simply checks the the path from the current environment (which is, of
course, inherits).

most shells (not all, i know) have "which" as a builtin, so it ought
not to make a difference.  of those that do not, they either have
aliasing (which is why which is a csh script in the first place), and
aliases ought to be included in the "search path" anyway (shells with
aliasing but no "which" can have a alias for "which" built for them).

shells that don't have "which" and don't have aliasing, will get what
they want from a binary.

did i miss anything?


|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."