From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23773 invoked from network); 11 Jul 2007 17:44:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Jul 2007 17:44:32 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 24343 invoked from network); 11 Jul 2007 17:44:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Jul 2007 17:44:25 -0000 Received: (qmail 3792 invoked by alias); 11 Jul 2007 17:44:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23672 Received: (qmail 3781 invoked from network); 11 Jul 2007 17:44:21 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Jul 2007 17:44:21 -0000 Received: (qmail 23971 invoked from network); 11 Jul 2007 17:44:21 -0000 Received: from redoubt.spodhuis.org (HELO mx.spodhuis.org) (193.202.115.177) by a.mx.sunsite.dk with SMTP; 11 Jul 2007 17:44:17 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=first1; d=spodhuis.org; h=Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=Vm3jvf3eiJpCxDSirOKTCnSXkxZeomaM7xF8P6ldRYDOxxvQVtyVeuzXZGey/NoPxNXB6Co1rZDvbUZHUtK0N26ELj/leUnqDoCDM96GpOd/fRHbwInDEfWTudB8t2CQzjV2mcrWfHtrukgFzlNDFUmMfxn7Kk1E6cWyXC9vqUs=; Received: by smtp.spodhuis.org with local id 1I8gEa-000FNQ-Nc; Wed, 11 Jul 2007 17:44:16 +0000 Date: Wed, 11 Jul 2007 10:44:16 -0700 From: Phil Pennock To: Zsh Hackers' List Subject: Re: command-not-found handler Message-ID: <20070711174416.GA45654@redoubt.spodhuis.org> Mail-Followup-To: Zsh Hackers' List References: <20070711112512.3abd2809@news01.csr.com> <20070711121632.58a8ecdf@news01.csr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070711121632.58a8ecdf@news01.csr.com> On 2007-07-11 at 12:16 +0100, Peter Stephenson wrote: > if this turns out to be useful. (Note I called it _handle*r* since that > seemed more natural. A handler is something that handles an error. A > handle is a reference to a data structure. If it means > handle_command_not_found it should say so. However, that's just me being > picky and I'm not particularly bothered.) > +If no external command is found but a function tt(command_not_found_handler) > +exists the shell executes this function with all > +command line arguments. I think that the Debian bash extender was just as picky. command_not_found_handle The name of a shell function to be called if a command cannot be found. The return value of this function should be 0, if the command is available after execution of the function, otherwise 127 (EX_NOTFOUND). Enabled only in interactive, non POSIX mode shells. This is a Debian extension. So I interpret that as meaning: unsplat_my_goofs() { blah; return 127; } command_not_found_handle=unsplat_my_goofs However, I'm unable to get this to actually work on the Ubuntu-derived distribution I'm using. -Phil