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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19025 invoked from network); 26 Mar 2021 12:53:42 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Mar 2021 12:53:42 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1616763222; b=oK3gFvrEJpI8+sDMO49c5QFvHBCVSPVHBToiRheZPFOau2rNSnin+Hk66QrE3FhN9w+3WgkNBk UgbyVMA0bfKuF9uTtti7Q4OaBqd4hjes0Nd7y7Z4fAyFimb0qxhgGRorYN9qhMaX+9ekb5L+Fs 0Mih2Tqx2RCSy7a8fa1nACrZauVBZXw81G/VKNxuvQ5rA7lKVP9yq6ho0Tvm6v1s/OKLyplzY0 XWzHd5wrU4EPMhx4qGix+r1tFkbAKFmMCgrXT31sA4Hk3AGN8dyvwdVVPq4f6fuC1NiNE9cBkr dqGMbeJlUKb1F028jUAPQUHExZkbmzVql/VJ1dJWFRYq0w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pf1-f176.google.com) smtp.remote-ip=209.85.210.176; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1616763222; bh=4vbvF/uJ5ClZpc/ZhjLsim9hrfBMyAsGtEHesPwjiME=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=qV7+TLe3r9U7RF7XAwrSe4K3FRHoXm3BRaWSl4jZv4oC5+7o6kYM1Xwtgcbphk7GkCt9figc27 FJwbuPRq+h46yzW4EjEFoiPBLMHNee2r/ZLqSQ8qhVe7A/upQxfPqiC8ZDBS4XPEvPxVDUcEEB fVQXeRJYf4r7POjbHRK3LcQVcVHz7LW64aXKKX9EAqTOKO6L/vSeLmsJ9ZhGgi6UWqDSt5VdJu mWNMSlkv7bCQndVkGdOxi84i9dOSRMiMFD1+PZqbp9Dew5qYMHgx9k4hn1S6q34gHc0LEQn2/D ioy0+PQeNiOeYU0/jMOA2LOaGHkv0wY4GnXkCyqpHXl38g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=epyH2iOilda2EQ05YwPg+gzqEoVlTsLx/MDAJkZlC2c=; b=JKGDClspuroFv29r7m8raZKKcj eIfk4rCJSmmShNK+pbjSojv+RDyeKc84kQ103YVdPV0Tg0hWR9srQZ2OMErGGdZ9/2IjticWIb6Gd UHnf5Hf2paGgAjCfN+F4wdoLfgUPfgbjUwT5niKx5sWLqYTCjMJgI0YkHtg6U34YWw3ZShriwSEGC 0ElcdMWvEfZYnhiHlM84uXCNJIT29ZL2o7zLh+ONpozc7yIlQ+A/Q2XZhmi3aarckglNCW4kmVSXq 4uT8kZBOL7ofpORZs4LPn+edp0Qt9A4s6pNDEkDJpKrXhN5me5EiWaxn+WS1LnJL4OX84m1fpfBM1 UzNpc9ZA==; Received: from authenticated user by zero.zsh.org with local id 1lPly8-000FLy-37; Fri, 26 Mar 2021 12:53:40 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pf1-f176.google.com) smtp.remote-ip=209.85.210.176; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pf1-f176.google.com ([209.85.210.176]:41706) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lPlxq-000FDY-BF; Fri, 26 Mar 2021 12:53:22 +0000 Received: by mail-pf1-f176.google.com with SMTP id l123so4809425pfl.8 for ; Fri, 26 Mar 2021 05:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=epyH2iOilda2EQ05YwPg+gzqEoVlTsLx/MDAJkZlC2c=; b=InE3dFICYyRHL6kOhaikJzYYWmBcVu6bVGdCvYCoT09djUzCuTEzvbF097qsmSIw+J Z63u+tzsdbUnhVhTXQSEffkQgCsJrLhfi8ORoej9uQpfLduVqJfgLvxF3d1AbQrJ22Rd 0DLKF57DW15oEr8gooGQG5+UrFSbXb4PVHDpNi4+ratcETM9xOExJUsb8tH7PogoYSPy YGtz5uGZXx9tXwFfbAOQUOLbSLAdWCah3gHVw/Y2YAV9HDfJyZgKvFcFOeVsnuL0aqRH 0o/y0nXmua+HkP2uFb4aRFljaeFTMdRXy05chhd8VdD6XnwPgY8X3meiIBDxfWsczVgm C7XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=epyH2iOilda2EQ05YwPg+gzqEoVlTsLx/MDAJkZlC2c=; b=Kb+mKALQw9UzYU4bS1b01i19hbpDkQUpUDe1NlZlqa954Oa0dfOgHbHMBumtamFF8X bq8CP8lhE51rhM/6MJWRrpKdyX4suwJuf0FScBoe9i0lPUpL3yfxBttmj4W/Xv1CTaKq Oi+SjubvFuR0oz01qIbuYh3XBdoLWvP5U41ekaCckB2XaAFxFNPLJRP+/rLOGNnGAA1b TBhT/Z6mDnO50LjvrlfTiXDBHhPGYrm2w4BKfgDkLvfPH+CyG/hYfIOUY/ZeabinEnWs gy386XqWGrX0IFR0v3EGbAS4Yi9ToMktuAfZbtGpTXuQcIf+nqRq0GcBIR6HrVAnlARU 9FHQ== X-Gm-Message-State: AOAM533Hmmw0oi5oAgpwBiNFcGe4/lGaBsb2yzbaggUCz/5JKIY2CZ/f 1GKuf3c024RMudtF+nNve4mD+Xuqak16g90V4FtBUC2CfJORCw== X-Google-Smtp-Source: ABdhPJz+PbYqbtGQgO8k17xJ/1cd3n4JaUvLyyWsZ5woSg6f5n7mZISq2TukcU2Lzs4XEA1AyxRwTpbI1X0jvd4DxyI= X-Received: by 2002:a62:e114:0:b029:20d:a7ca:3a36 with SMTP id q20-20020a62e1140000b029020da7ca3a36mr12717110pfh.24.1616763199946; Fri, 26 Mar 2021 05:53:19 -0700 (PDT) MIME-Version: 1.0 From: Rudi C Date: Fri, 26 Mar 2021 17:23:08 +0430 Message-ID: Subject: [BUG] Pipe fails even when using ' || true ' To: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 48247 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: Archived-At: This pipe unexpectedly fails: ``` $ setopt pipefail $ { print -nr -- "x" || true } | eval 'print -rn -- "${(q+@)brish_stdin}"' ; echo $'\n'Returned $?:"${(j.|.)pipestatus[@]}" '' Returned 141:141|0 ``` This is the simplest thing I have found that works: ``` $ ( ( print -nr -- "l" ) || true ) | eval 'print -rn -- "${(q+@)brish_stdin}"' ; echo $'\n'Returned $?:"${(j.|.)pipestatus[@]}" '' Returned 0:0|0 ``` Even this fails: ``` $ ( { print -nr -- "l" } || true ) | eval 'print -rn -- "${(q+@)brish_stdin}"' ; echo $'\n'Returned $?:"${(j.|.)pipestatus[@]}" '' Returned 141:141|0 ``` The behavior is nondeterministic on macOS, and it actually doesn't usually fail at all! ``` $ for i in {1..100} ; { { print -nr -- "x" || true } | eval 'print -rn -- "${(q+@)brish_stdin}"' ;echo $'\n'Returned $?:"${(j.|.)pipestatus[@]}" } '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 141:141|0 '' Returned 0:0|0 '' Returned 0:0|0 '' Returned 0:0|0 ``` BTW, there seems to be another weird thing going on; Adding two spaces before `echo` breaks the whole loop both on Linux and macOS: ``` for i in {1..100} ; { { print -nr -- "x" || true } | eval 'print -rn -- "${(q+@)brish_stdin}"' ; echo $'\n'Returned $?:"${(j.|.)pipestatus[@]}" } ''zsh: command not found: ''zsh: command not found: ''zsh: command not found: ''zsh: command not found: ... ```