From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17066 invoked from network); 11 Feb 2005 18:52:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Feb 2005 18:52:38 -0000 Received: (qmail 98735 invoked from network); 11 Feb 2005 18:52:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Feb 2005 18:52:31 -0000 Received: (qmail 14072 invoked by alias); 11 Feb 2005 18:52:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8489 Received: (qmail 14058 invoked from network); 11 Feb 2005 18:52:23 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Feb 2005 18:52:23 -0000 Received: (qmail 97649 invoked from network); 11 Feb 2005 18:51:47 -0000 Received: from out014pub.verizon.net (HELO out014.verizon.net) (206.46.170.46) by a.mx.sunsite.dk with SMTP; 11 Feb 2005 18:51:43 -0000 Received: from candle.brasslantern.com ([4.11.10.129]) by out014.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20050211185141.PSLT28388.out014.verizon.net@candle.brasslantern.com> for ; Fri, 11 Feb 2005 12:51:41 -0600 Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j1BIpVi3025873 for ; Fri, 11 Feb 2005 10:51:36 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j1BIpQ6W025870 for zsh-users@sunsite.dk; Fri, 11 Feb 2005 10:51:26 -0800 From: Bart Schaefer Message-Id: <1050211185125.ZM25869@candle.brasslantern.com> Date: Fri, 11 Feb 2005 18:51:25 +0000 In-Reply-To: <200502111445.j1BEj2Mp021524@news01.csr.com> Comments: In reply to Peter Stephenson "Exception handling" (Feb 11, 2:45pm) References: <200502111445.j1BEj2Mp021524@news01.csr.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk (Zsh users list) Subject: Re: Exception handling MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Authentication-Info: Submitted using SMTP AUTH at out014.verizon.net from [4.11.10.129] at Fri, 11 Feb 2005 12:51:37 -0600 X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Feb 11, 2:45pm, Peter Stephenson wrote: } } I wrote the following test, with descriptions of what's going on. If } it's interesting I can add bits to the archive. It's interesting ... just two comments: } # Raise an error, but don't show an error message. } # This is a bit of a hack. (Surprised?) } { ${*ERROR*} } 2>/dev/null How about something a little neater, like { ${:?THROW} } instead? The problem with relying on invalid syntax is that it might become valid later. (Like "{ foo } always { bar }" did, for example.) } # grrr.... if this is rerun, catch mustn't be an alias when we define } # it as a function... } unalias catch 2>/dev/null If you used "function catch { ... }" you wouldn't need the unalias, but if you need unalias you probably need "builtin unalias".