Date: Tue, 28 Nov 1995 14:12:41 +0100 (MET) From: grog@lemis.de (Greg Lehey) To: chuckr@glue.umd.edu (Chuck Robey) Cc: hackers@freebsd.org (FreeBSD Hackers) Subject: Why is 'which' broken? (was: Where is the documentation for ibcs2?) Message-ID: <199511281318.OAA26089@allegro.lemis.de> In-Reply-To: <Pine.SUN.3.91.951127191747.16234D-100000@latte.eng.umd.edu> from "Chuck Robey" at Nov 27, 95 07:20:35 pm
next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Robey writes:
>
> On Mon, 27 Nov 1995, Greg Lehey wrote:
>
> > BTW, 'which' is broken. It doesn't pay any attention to the PATH
> > environment variable, so it can't tell you which one you'll run, just
> > the one it thinks most likeley. This can be *very* confusing for a
> > newbie.
>
> Greg, I hope I haven't taken your remark above too out of context, but
> I'd like to contest your assertion of 'which' being broken, seeing as it
> works quite well for me. I know it certainly does take MY path into
> account. Could you explain why you think it's broken?
Well, the reason why I *thought* it was broken was
1. It used to be broken in BSD/386.
2. When I tried it here, I created a file ls in my home directory,
which is at the front of my path. which ls didn't find it.
The problem was that I hadn't set ls to be executable, so this was
correct behaviour. After setting it executable (and looking at the
source), I see that it does, in fact, work correctly.
Mea culpa
Greg
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511281318.OAA26089>
