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 819 invoked from network); 5 Jul 2023 23:19:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Jul 2023 23:19:16 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1688599156; b=TN5ZglTQNeVdk/BkwFrD17CkdDEywZnYnUPwzjlDkYlw85kMGcOkKxNow6YqglMbqXGQN5sh6F zn/qEjF13KsIl/tPOP3QbM8eAof/Lk5k1qT9+GSGVSvVexXkH2M7UTYfVrN5ctkRRhScFG1YyZ 80uwRb1VQxoNRPU5t/5Cq2/NV6G0Pix7NtT/zDg/jDKi5VT1uSKs2qVrp4BFoq2Vo0MJ7XcUCO P2fXTBW156lw7t44kx2bWSM8mycytLSb6MGP9du7Gz8hGpHkiV8E08AesC7876he5CMo1Lp5Wi k5ktah4EIIXgSSjB1GGhGtS3tLoeC1AuntbYf0aSPdgbSw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (redisdead.crans.org) smtp.remote-ip=185.230.79.39; dkim=pass header.d=crans.org header.s=mail header.a=rsa-sha256; dmarc=none header.from=crans.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1688599156; bh=F79MF4gyVLIblH6F/PG6DQSkHGfHbv1iDqXtS4ODROM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:From:To: MIME-Version:Date:Message-ID:DKIM-Signature:DKIM-Signature; b=RTpxhjLW/5SzNUttH59V2x7vBxOpUCJrkyfJhxOSkwyiS66SWK0Gwi8mihsAPc8IDvOlidP0fP wqhJjwcH+5SV/kPam3I3IM/Ly9ti9b//OwxhSMGp9+Ttj/O7wf/Hf90hhmMtw2F4qudQDNOKDx YNy4ItpyEhJnPaLn3gibImnNvURQpNVE1GgM0RS8uhtOha8Cn9Apxsi9FLWh6WHFNyMAXBoZhX FHC4sp4kl7r5dB1551kaWFtbj0YYs3QuLFYlij+KyZTA53cZ2a5/YHoqnDcjyinfdGPnR7IzPI jieihwZXuwkefY9lA1KQtD3jle8gxJfL3kbhLjT0mT35WA==; 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:Subject:From:To:MIME-Version:Date:Message-ID:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=dkPNlOKOh59UKKxV051j7ThhItQM1Z42nXvsQW+nhZ4=; b=MpJaJnh2AyReJi0oWn56q2gvaz VjxGBZ2ORQlr/x45ZW5fqCWBnpgKxX4gxHF+kcmWAG/sw080ZUGlk2HS80+FxmUMx5zL9uPaitV/a Ex65Kr5R+sA5uZRogNoZP1jC0MrQ6F5yQXo8JOTCz2JuE3Saf6f1CTDR6z5V3Wo/gFRVYWBGd7Lkj SaPSHdLkeK7D6s55JLKWo1dfiZ6/xTBGlPYx9PH9lPXceZrx4Dnwxi5uH2p9LxEXc0IKsBbKR0Ume ZcP04eHSzjARvAli1tyn5bL14nxh5AOURVYfSlnk6J4ND2915Nz3t297CSMNhyETgVo72N9Oe3EmZ Fi1wlYxw==; Received: by zero.zsh.org with local id 1qHBmE-0002mD-9v; Wed, 05 Jul 2023 23:19:14 +0000 Authentication-Results: zsh.org; iprev=pass (redisdead.crans.org) smtp.remote-ip=185.230.79.39; dkim=pass header.d=crans.org header.s=mail header.a=rsa-sha256; dmarc=none header.from=crans.org; arc=none Received: from redisdead.crans.org ([185.230.79.39]:52914) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qHBld-0002Sw-BR; Wed, 05 Jul 2023 23:18:38 +0000 Received: from [IPV6:2a01:e0a:1aa:1110:21cf:4256:124a:f370] (unknown [IPv6:2a01:e0a:1aa:1110:21cf:4256:124a:f370]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by redisdead.crans.org (Postfix) with ESMTPSA id 9C2BA249 for ; Thu, 6 Jul 2023 01:18:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crans.org; s=mail; t=1688599116; bh=F79MF4gyVLIblH6F/PG6DQSkHGfHbv1iDqXtS4ODROM=; h=Date:To:From:Subject:From; b=Q4wxvrNDPAsWA4jgfoK3iepgw43r2P0UW2ZYGj3oX661cK5CaZtUYp58XAneTcPKu oKzNPY5P5eiCKrUGhvgEpBCSPlfmCfH3kzGtp14O/cimUFZPiChxZ4RBiOL3gC1X6b ezxe/FivKp9l4tnk3oUcoN/fuadjCXGA+aHWafBNFRRaeRtVfdhh0p6K1MeKvj97NN 1gzOjLw0XLHvUr0b57cHTOTVI/6KAwSu9RwneJHOCSMViTospcPFb7virUp6kFW3y2 nEAR874p1ntTtuZvQkb3UoOBCt/PHCmZI97vmP44wWyDBAyn/p09eG+rbMQKoTn4CV Xm8vNu0NaqU1yqoJZktQzHvRpmouQKyyLlMqJlIT7BHI3ve7Xiu/mzGHDZvOcZwtla pVfTAySeF5HY//dgVaa6A4KJxgDJKnaVswhlbg7OIsbC3feNrsVS4ZPPk2yrty71P0 7V9TZsWFbYmOV4SITwbjBPMCyZ9XgvOkh5qA1C4uXB95YP8ZO1xTHjsGFRYwGBRlpn F4y1O4F0tiK+UG4WyP+GM/rfGANPFRfQVCxMg1F9AOlC9ZTLXwn4s3Yf3TFvTG2wjF JogRuQbR16ZcobFzWvFe73bEAm9f00RLpMaFAERc1tFndVMPIlV5FVB/0I0aO0FcV8 +1vr3scFLUnU4LuWTUw+jgVc= Message-ID: <0c1f1b1e-7d2b-ec6b-3044-dc25b6d5a4d5@crans.org> Date: Thu, 6 Jul 2023 01:18:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 To: zsh-workers@zsh.org Content-Language: en-US, en-AU, fr From: Johan Grande Subject: Failed pipeline doesn't err_exit/return if complex command last Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Seq: 51904 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: Hi all, 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): false | if true; then true; fi echo $? => prints "1", exits with 0 However, this only occurs if the `if` command is last. If we add a `| true` at the end: false | if true; then true; fi | true echo $? => no output, exits with 1 Same with a while loop (I only checked these 2 complex commands): false | while read line; do true; done echo $? => prints "1", exits with 0 false | while read line; do true; done | true echo $? => no output, exits with 1 It seems inconsistent to me that a complex command be treated just like a simple command in the middle of a pipeline but not at the end, making a "list" that has non-zero status but doesn't return/exit despite the options. As a sanity check, I ran the examples with bash and the result is what I would expect in all 4 cases: no output, exit with 1. I'm using zsh 5.8.1 (x86_64-ubuntu-linux-gnu). -- Johan Grande