From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4064 invoked by alias); 11 Jan 2011 03:28:08 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28625 Received: (qmail 3193 invoked from network); 11 Jan 2011 03:27:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.178 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=iEhZgXm5rxqzJSw4ffrhX3mlxgRnzhZbDi2JBZLGUzA=; b=lMBq1LdJkfCs/TikuzWvwWCCIbVt7LF9LbEY9T7kTfY7R1vDPAVX5n9FGp8lkJeNip RmCX7ZImzgqIlvWebBWyOwivu6Ov71TlYJtFlfEvzVfgAcvz7fSi45RPbzQ7mpoMXV++ lCE83MrcB2f+/M+JpTvNpGvuySmhAG/yiwnos= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=P2Zk1XHv0w2XnC3h/7Bg84VDAvy6A1A6TpZ4kKXsFqRC4tnAoh84PXkvw92R4+89be 7jT9AqkpRWSWlT0uQPpqqsmf1ux/2yN5M9JAmbusZ3dIGOXiZzulgW1inp015Q5q9Z/9 dNoF/I47RD6GgdRmxpqEX6LGuULR+wKGLveYY= MIME-Version: 1.0 In-Reply-To: References: <1294704977.26846.1414490063@webmail.messagingengine.com> <1294710389.18824.1414500371@webmail.messagingengine.com> <1294714469.3446.1414534693@webmail.messagingengine.com> Date: Tue, 11 Jan 2011 04:27:50 +0100 Message-ID: Subject: Re: 4.3.11 TRAPEXIT() on cygwin From: Mikael Magnusson To: Anthony Heading Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11 January 2011 04:25, Mikael Magnusson wrote: >> When a subshell is entered, traps that are not being ignored shall >> be set to the default actions, except in the case of a command >> substitution containing only a single trap command, when the traps >> need not be altered. > > Ah, the manpage says this > ( list ) > Execute list in a subshell. Traps set by the trap > builtin are reset > to their default values while executing list. > > and it is true: > % trap 'echo hello >&2' EXIT > % a=3D$(ls) > % TRAPEXIT() { echo function hello >&2 } > % a=3D$(ls) > function hello One might take issue with this statement in the manpage though, The functions beginning `TRAP' may alternatively be defined with the tr= ap builtin: this may be preferable for some uses, as they are then run in t= he environment of the calling process, rather than in their own function env= i=E2=80=90 ronment. Apart from the difference in calling procedure and the fact th= at the function form appears in lists of functions, the forms TRAPNAL() { # code } and trap ' # code ' NAL are equivalent. --=20 Mikael Magnusson