>On all systems to which I have access, including SunOS,
> file `which which` returns
> /usr/ucb/which executable <shell> script
>And, upon examining said script, one notes it manually stat's each path
>in the path list. Yes, "which" includes aliases; but it does _not_
>use the _current_ path variable -- it uses _only_ the path established
>in the users .cshrc file. This could be seen as a limitation.
I would like to note two things:
- tcsh (and, if I'm not mistaken zsh which I don't use)
has a built in which command which is not only faster,
but works as people expect.
- /usr/ucb/which can be modified rather simply to use the
current path. The way my script is written if you don't have
a ~/.cshrc it uses the current path. If you don't run csh
then it will be using your current path (since other
shells use .tcshrc, .bashrc, .zshrc, .profile)
Also of interest might be that the SCO SysV system I have
access to right now does not have a which command in any form. I'm
going to have to compile tcsh on there I guess.