From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1944 invoked from network); 18 Sep 2001 17:38:47 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Sep 2001 17:38:47 -0000 Received: (qmail 21871 invoked by alias); 18 Sep 2001 17:38:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15842 Received: (qmail 21848 invoked from network); 18 Sep 2001 17:38:39 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: trap for EXIT doesn't catch exit? In-reply-to: "Bart Schaefer"'s message of "Tue, 18 Sep 2001 10:29:30 PDT." <010918102930.ZM7932@candle.brasslantern.com> Date: Tue, 18 Sep 2001 18:38:05 +0100 Message-ID: <29251.1000834685@csr.com> From: Peter Stephenson Bart Schaefer wrote: > I don't think it's sufficient to simulate exiting the scopes, because the > traps have to execute as if they're in the scope where they were installed. > It may be necessary to actually unwind the stack; at least it's necessary > to call endparamscope() and endtrapscope() the correct number of times. Yes, that eventually occurred to me. > We may want to bring this up on the shell@research.att.com list. Possibly a good idea, but the other shells' behaviour, having an exit trap only for the shell, already seems to be standard. We would need to treat it specially as an option. It's a bit of pain because this works 18:34% ksh $ foo() { trap 'echo exit' EXIT; } $ foo $ exit exit while most (or maybe all) other traps in ksh are local. That is, at least, an argument for our way of doing it. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************