From owner-freebsd-hackers Tue Nov 28 05:28:09 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id FAA05718 for hackers-outgoing; Tue, 28 Nov 1995 05:28:09 -0800 Received: from cls.net (freeside.cls.de [192.129.50.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id FAA05678 for ; Tue, 28 Nov 1995 05:28:05 -0800 Received: by mail.cls.net (Smail3.1.29.1) from allegro.lemis.de (192.109.197.134) with smtp id ; Tue, 28 Nov 95 13:28 GMT From: grog@lemis.de (Greg Lehey) Organisation: LEMIS, Schellnhausen 2, 36325 Feldatal, Germany Phone: +49-6637-919123 Fax: +49-6637-919122 Reply-To: grog@lemis.de (Greg Lehey) Received: (grog@localhost) by allegro.lemis.de (8.6.9/8.6.9) id OAA26089; Tue, 28 Nov 1995 14:18:37 +0100 Message-Id: <199511281318.OAA26089@allegro.lemis.de> Subject: Why is 'which' broken? (was: Where is the documentation for ibcs2?) To: chuckr@glue.umd.edu (Chuck Robey) Date: Tue, 28 Nov 1995 14:12:41 +0100 (MET) Cc: hackers@freebsd.org (FreeBSD Hackers) In-Reply-To: from "Chuck Robey" at Nov 27, 95 07:20:35 pm X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1007 Sender: owner-hackers@freebsd.org Precedence: bulk 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