Subject: failure notice
To: None <netbsd-bugs@netbsd.org>
From: None <MAILER-DAEMON@mail.netbsd.org>
List: netbsd-bugs
Date: 08/03/2000 21:13:36
Hi. This is the qmail-send program at mail.netbsd.org.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<netbsd-bugs@netbsd.org>:
This message is looping: it already has my Delivered-To line. (#5.4.6)

--- Below this line is a copy of the message.

  by mail.netbsd.org with SMTP; 3 Aug 2000 21:13:25 -0000
  by mail.iac.spb.ru with SMTP; 3 Aug 2000 13:24:38 -0000
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: woods@weird.com (Greg A. Woods)
To: netbsd-bugs@netbsd.org
Subject: Re: bin/10611: /usr/bin/which reads user's .chsrc even if user's shell is not csh 
In-Reply-To: <1759.963996702@mundamutti.cs.mu.OZ.AU>
References: <200007190653.XAA29194@shell17.ba.best.com> <1759.963996702@mundamutti.cs.mu.OZ.AU>
Reply-To: netbsd-bugs@netbsd.org (NetBSD Bugs and PR posting List)
Organization: Planix, Inc.; Toronto, Ontario; Canada
Message-Id: <20000720160354.0BBAD8D@proven.weird.com>
Date: Thu, 20 Jul 2000 12:03:54 -0400 (EDT)
Sender: netbsd-bugs-owner@netbsd.org

[ On Wednesday, July 19, 2000 at 18:51:42 (+1000), Robert Elz wrote: ]
> Subject: Re: bin/10611: /usr/bin/which reads user's .chsrc even if user's shell is not csh 
>
> Today, the best solution is probably
>       rm -fr /usr/src/bin/csh /usr/src/usr.bin/which /usr/pkgsrc/shells/tcsh

I couldn't agree more!  (remember http://www.perl.com/pub/language/versus/csh.html)

However as a *former* (LONG former!) csh user I still find my finger
memory sometimes types "which" before I think to type "type", so since I
have done the above already on my development systems I've replaced
/usr/bin/which with this quick little hack:

        #! /bin/sh
        :
        
        if [ "$1" = "-a" ] ; then
                echo "$(basename $0): -a not supported in this version" 1>&2
                exit 2
        fi
        for prog
        do
                location=$(expr "$(type ${prog})" : '[^/]*\(.*\)$')
                if [ -n "${location}" ] ; then
                        echo "${location}"
                fi
        done
        
        exit 0

-- 
                                                        Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>