Subject: Re: bin/10611: /usr/bin/which reads user's .chsrc even if user's shell is not csh
To: matthew green <mrg@eterna.com.au>
From: Todd Whitesel <toddpw@best.com>
List: netbsd-bugs
Date: 07/18/2000 23:53:08
> Hmm, maybe the which(1) man page should be tweaked a little to make it
> really clear that people not using csh should instead use alternatives
> such as whence.
...
> this is probably the best way to avoid future issues with it.
Okay.
How about this (I am not a 'roff jock so feel free to correct my macros):
Index: which.1
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/which/which.1,v
retrieving revision 1.6
diff -u -r1.6 which.1
--- which.1 1999/03/22 18:16:47 1.6
+++ which.1 2000/07/19 06:50:39
@@ -75,9 +75,25 @@
word,
or if an executable file with the argument name was not found in the path.
.Sh BUGS
-Must be executed by a
-.Xr csh 1 ,
-or some other shell which knows about aliases.
+.Nm
+always sources the user's
+.Pa \&.cshrc
+file if it exists.
+This is arguably wrong, but it is the historically established behavior.
+Users of shells other than
+.Xr csh 1
+should avoid
+.Nm
+in favor of their chosen shell's equivalent command.
+For example,
+.Xr sh 1
+provides
+.Ic type ,
+and
+.Xr ksh 1
+additionally provides
+.Ic whence ,
+for this purpose.
.Sh HISTORY
The
.Nm
Todd Whitesel
toddpw @ best.com