From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7840 invoked from network); 23 Mar 2004 18:21:05 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Mar 2004 18:21:05 -0000 Received: (qmail 29256 invoked by alias); 23 Mar 2004 18:20:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19678 Received: (qmail 29245 invoked from network); 23 Mar 2004 18:20:54 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 23 Mar 2004 18:20:54 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 23 Mar 2004 18:20:54 -0000 Received: (qmail 26929 invoked from network); 23 Mar 2004 18:20:54 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO binome.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 23 Mar 2004 18:20:50 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id 588BE2BD0; Tue, 23 Mar 2004 10:20:48 -0800 (PST) Date: Tue, 23 Mar 2004 10:20:48 -0800 From: Wayne Davison To: "Nelson H. F. Beebe" Cc: zsh-workers@sunsite.dk Subject: Re: zsh-4.1.1 and trap '...' DEBUG: a bug or a feature? Message-ID: <20040323182048.GB30758@blorf.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Tue, Mar 23, 2004 at 10:54:22AM -0700, Nelson H. F. Beebe wrote: > Notice that zsh takes one final DEBUG trap that bash does not. This is because your EXIT trap had one command in it. If it had two commands, you would have seen two final DEBUG trap executions. One way to avoid this is to turn off DEBUG in the exit trap: trap 'trap - DEBUG; echo This is an EXIT trap' EXIT trap 'echo This is a DEBUG trap' DEBUG pwd pwd pwd pwd That would duplicate the bash behavior you saw. However, I don't know if this is proper POSIX behavior or not. ..wayne..