From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24039 invoked from network); 6 Jul 2023 09:49:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Jul 2023 09:49:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1688636979; b=hH4e3FjDezMiU0ND6yM7IAUF9771xGgd6A1r+xlzR20t2gpLneiQq8BDZBbfG8MtQsfLnZ+VZO sV92x+dUVxEwTJS3KJVPHBD21jxo6NqirltHe0JMtEL0dHnzXMW2bMacxJjmBeLv+KtEsh/H2s aFihD62eAOxqv4fFzxxVqRNmBNP50OyQ97SCrEwt1aNxh8xAuVYV1Kwpcq3E6PiEe9xDcwKHj6 f8LFRFZjIGAp7FhobcHdk1K2/phdaLACdddCpmIelg57804IVXixhjSUmd8nFlz5XpuqKrU1Qm 1ZNwbo+wp7zFTqTC7doKrEsPVN/DncTJrCSY17u7nB5Ywg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq3.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.98; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1688636979; bh=FinBn2C9Cm2yscN2ALqjOaOoMvrAD6O7lclg0TPGioE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=jKa/i0VXXcM+yHhJPScxERPkuNqlNT6zrTkJpB5Y3FbzIJYj9oJOPzTsX9LmekGmLA2FBhj2tt ZA6yNFIy8JGDmMbEwvUWOS9P+bO3gpZx9PhH+Po3I1BR4gMjvkS2sHTKELBjJGZWtb2n9oGfO+ cALpgmLE+YHV9kD6fJxo9wG319CbQKTqatZQspRss00Q1yeBCVpTS0xPvKQyAwQ2FYe44n8DrF pDu/YGv1hgC5SzonDyi69v9+DaHDuEJ6YzhzaQnrAo/TYRj52wOBsNzwdtrkfZPiNHPfQKKNbH cWDtBap8b2a2/gw7yjNCoD0GcUJbNv/u0LGMNiefTbabKA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ODhKvPph74L0C2wvdFkWXA1CKk7K8NE0cCh7W8IMMrM=; b=ZU3XqgHRXIaXZQXTlmI/cHvzdU 1yf+zF0l4Ttop2h3OA3t0/qPeMGrIrc9JOoP17fbG4w0VVexQWauXuYHJB10raCKGKnONsHnZXow/ JxzK0dDT2JPAftn5V/w46sdnTiX+zegac87tVMTe+Bb5aVljvzhvbF/G5nOTGXxju/WzLA0PVxUs3 GWpqKXauztixTsJEIK2sVn27ND0CGR/MVS9dqgF5tyJpvDNGl3zkN737UxEiuIotoqfh4DzdAZmKF jgizO9D4taAJeB23Fj4P/Kf47exoibvo7wygzH1Z++IMHXBTk484aP9TLpXvqeBimOpIEOnHc8ZKT u+gy7tHw==; Received: by zero.zsh.org with local id 1qHLcH-000MtA-IO; Thu, 06 Jul 2023 09:49:37 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq3.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.98; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq3.tb.ukmail.iss.as9143.net ([212.54.57.98]:43150) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1qHLWr-000MR1-76; Thu, 06 Jul 2023 09:44:03 +0000 Received: from [212.54.57.126] (helo=csmtpq3-prd-nl1-vmo.edge.unified.services) by smtpq3.tb.ukmail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHLWq-0002Qo-GP for zsh-workers@zsh.org; Thu, 06 Jul 2023 11:44:00 +0200 Received: from oxsmtp2-prd-nl1-vmo.nl1.unified.services ([100.107.83.137]) by csmtpq3-prd-nl1-vmo.edge.unified.services with esmtp (Exim 4.93) (envelope-from ) id 1qHLWq-008LY7-69 for zsh-workers@zsh.org; Thu, 06 Jul 2023 11:44:00 +0200 Received: from oxbe2-prd-nl1-vmo.nl1.unified.services ([100.107.83.19]) by Virgin Media with ESMTP id HLWqqYOx13QTlHLWqqT6iF; Thu, 06 Jul 2023 11:44:00 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 100.107.83.19 X-CNFS-Analysis: v=2.4 cv=AOnkBvka c=1 sm=1 tr=0 ts=64a68ce0 cx=a_exe a=Ug4nl6DLES5uBG/ShwgD6g==:117 a=IvlwODmuRu4A:10 a=IkcTkHD0fZMA:10 a=dGsWvjqBAAAA:8 a=VMDxll6oTDwBv91coT4A:9 a=QEXdDO2ut3YA:10 a=EwAE0RQWx3bH85eTCWcH:22 a=HbQOABYz3jhqdZF7JfnK:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1688636640; bh=FinBn2C9Cm2yscN2ALqjOaOoMvrAD6O7lclg0TPGioE=; h=Date:From:To:In-Reply-To:References:Subject; b=tdxVuNXt2aCCaj5O6XE+Xurwo844uj/lUFwass+qT8BX+udaZLVikZZpcm/SzMeol duGaYYFFCqZqbKSOkcsnxPPq30kOrTk7sJHzxUrC9Wq79ZHx4uurKBrHoYnYPNDeXF zCtn5wtAfi93rdVp7RQRsh0J6XNe347qzgHXrbwmzT2MvmE7oJ4xX9dP70vLUHTXcw gAL3VA0LXOcdFEOx0opy0EYyFahOCZjHrrt94QPR2FvbcL2tdIE/zooIpAE17DgQIx Yy5fgZFdq841CaHUTUAhDJvSPuefcM3W+DoSDRp38YYWdEoANDyRO/2/RTuko+0vYc 5PEI5i1Jhy+/w== Date: Thu, 6 Jul 2023 10:44:00 +0100 (BST) From: Peter Stephenson To: Johan Grande , zsh-workers@zsh.org Message-ID: <1263859119.226140.1688636640060@mail.virginmedia.com> In-Reply-To: <0c1f1b1e-7d2b-ec6b-3044-dc25b6d5a4d5@crans.org> References: <0c1f1b1e-7d2b-ec6b-3044-dc25b6d5a4d5@crans.org> Subject: Re: Failed pipeline doesn't err_exit/return if complex command last MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer X-Originating-IP: 147.161.224.196 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfC3YqP9mN8/gX8sGUX1aHts2i6xKEUtnamPjr7kTH33shG8Hnv4R0bLIHmxeNC1+FBJeM4eOvQUGlcf1ZmXXo6tlBlBaU074ap2Qa/3ON0CcWZYdQWsG 3R9XeF36+LpSuEMWdLweObkTV2QJr3SI7XuZArfjoNWM3PmqRuMTOo/1l8ZKmWNVB9jk3YGUuJrlUKnv2xXJhT9xw/z4k1AZYLsbkXd27ZCoUL8Ec+YlFSk3 RDiXP8iG6dO7mv+05sKMHQ== X-Seq: 51909 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: > On 06/07/2023 00:18 Johan Grande wrote: > I noticed a strange behavior when using a complex command in a pipeline. > > With `set -eo pipefail`, a failing pipeline that ends in a complex > command will have non-zero status but not exit the script (or a function > with err_return): So in a nutshell fn() { emulate -L zsh setopt errreturn pipefail false | { true } print "Shouldn't get here, status $?" } The final part of the pipeline is run in the current shell, so the job control is a bit fiddly. It looks like the relevant code, including the function storepipestats(), is run too late in this case. pws