From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11400 invoked by alias); 10 Nov 2016 05:20: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: 39898 Received: (qmail 14248 invoked from network); 10 Nov 2016 05:20:08 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f180.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.217.180):SA:0(0.0/5.0):. Processed in 0.909915 secs); 10 Nov 2016 05:20:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.180 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=7MsB0XUdAY2SwFISe8yvNDwrHGGBlwF9VFgF4BJcnys=; b=DaIjYkTK2vw0K+0yyRz4FpWx82A9vf01ifsMVCr73F18KJxlx2rFGd2JQ/bhfLlSx6 s+DO72vkt2+CYm3IM5HEU2spHt8Qu2GH/lfQ0OlST6hRfImvfnqmq4I2TqmbrU8H9qP1 tYn9DKvIgSOL17TFdhVg/T6+zRK0Y+49ahev2GDTtorhAluLIWV4qB9nfocEyDofl4KF clr17AQ6mySx1Uhyt8wGJ5yt3cdgnzrZXr2vHujKcev3p0GWPRhWqJZzDP230Ovr14ku petQOGZJeyBK44M+GtsU5Ju/WxJmj8J4BuudY2H6VWhBOgVQRY1Yv7815gBjGREzq8ZJ Fsxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=7MsB0XUdAY2SwFISe8yvNDwrHGGBlwF9VFgF4BJcnys=; b=g2+Phpyybv4fF58Mopjf59ZkeOM+eX944koDv9IHXOk/eZYe/AN+0HXz6D64iIM1qe nEOuxjZjKtqvIpCQmzwqe0i22ZYySVeN7Dj4cmPWWpfo3FaiHjEZWvdB26zLpJwQ1xiZ jnQgFSMuAY+1t7gy5wYXdtOD9VATc0eajzi0AaBYK1fhuwQlDCIr9XsMtsrlJqA6npl/ 7wopEuhPZkcPQK/x3NqZiNHcfM3ppDY2BvRfn9mVS+RFa7LMOs4xW7tlPVSJZfzIuKb/ FiqbSmz+Ptbn9viQQZX3s/wWRQoaPH78lpJju669/ZZqXkGIqTNmXdL69izDnUCSAsTF DAuA== X-Gm-Message-State: ABUngvcY0kfuqV7sRLdHc1rLbqTh2AXYEQ6rK0T1sgC5M18HK3gYKzsfTF5QQucM3aTOfw== X-Received: by 10.176.85.83 with SMTP id u19mr1953461uaa.82.1478755198542; Wed, 09 Nov 2016 21:19:58 -0800 (PST) From: Bart Schaefer Message-Id: <161109211957.ZM4353@torch.brasslantern.com> Date: Wed, 9 Nov 2016 21:19:57 -0800 In-Reply-To: <1478745377.2440153.783050761.5D9FA45B@webmail.messagingengine.com> Comments: In reply to Anthony Heading "exit trap and list pipelines" (Nov 9, 9:36pm) References: <1478745377.2440153.783050761.5D9FA45B@webmail.messagingengine.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: exit trap and list pipelines MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 9, 9:36pm, Anthony Heading wrote: } } Printing '6' here seems wrong? I think it didn't some years back. } } % zsh -c 'trap "echo hello" EXIT; { :; } | wc -c' } 6 } hello zsh-2.6 and zsh-3.0 yeild 0, zsh-4.3.17 prints 6. The change occured because, where zsh formerly would note that the right side was an external command and "exec" it (thereby disabling the exit trap), newer zsh notices that there is a trap and does another fork so that the trap can execute after wc finishes. This means that both sides of the pipe run the trap, whereas before (and in bash) only one side does so. However, in the older zsh case, there were circumstances in which the trap did not execute *at all*. commit 261193a5b7da4ba36ca146424b000aca27c69235 Author: Peter Stephenson Date: Fri Mar 30 16:51:54 2001 +0000 Fix problem with traps not runing if shell exec'd final command (workers/13851)