From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id AF39720CC9 for ; Fri, 21 Jun 2024 20:47:09 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1718995629; b=clF+8SEVpi4vKwQyBBHgZoPDAnssFl0UzWCwuo7W4FWJYCe1duPhUp6jmNQm+zHC7yqPsCwOqA q2u7XLy/XIdgYx5EwFrMGuBEBX247QQcsxbYxWR2isAMvqBNdAWxksrHe4soLgJxVXIEr2p9/B dF/0xsLZp7q0/NpMQrqzxyupY7CEzSfoqh/86BIEW4FLCpEEnsyOZX1mvJ7bgxIaSMnSuEnB1G 7lZyA6Kxa8WPnZwe0mRC9BovtfufyZBP/ZpmhPKDMu7HeRd5GBx3AuXO9493MmfXTEN2bRJ+rk dCCrHn4/QOUC5nPWROKz26EozsEKv22TIpr3YBDmu5QH8A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f43.google.com) smtp.remote-ip=209.85.218.43; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1718995629; bh=lPTT9SnaOKhDsC6l2Un/XvaJBUWzVdFDaZ/ncKS+Ku8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=pzRir5nUAo4GsF23qa7w0+c+7V0iSRuja3LYdQaxMq/V+coXpwwSH0d7LEdVA+ZqXUZbBPA8IK 6cRIA7ylB0IdeuvobVSdP2HTOZuGRpW+3fcgviD2qLtcTf8/F5UYgc+AO2UExYVML9YhOGSL6H H8c6O5bgwBjDc+9elzERsLwpDDnHC2ZWWVQBwMYnUXB9R3vrJ+VO/yD+9xd0mglpHuMI6s9QiA 88/DsrGXZ1ej0Rqo0FnWAPIE3b3MXQT95HbdBIMBx+yCZIJpcNBrTeZCSMdzgKDX2perRFBpko HwgFfK7GVSMbmtQoHWAjfj2Sl4x81FRR3m009XmmRTUT0A==; 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:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=DuUagwuGDTwE8LbLpyRgYKOrumyxUs/NF1MMpk+e27o=; b=HpNKxztIlDkWqi/leguKaXpaNp 1CJtVLs9RHtMZJ/5S//k1ENVftaPfTYR0MvA5ZvR8hYpv9lX0E0i0K2b+lZnaNfYWZRvqr/2Zs0i3 B+g2wey0svjX73KnJ1bEdHhZ/v6Fhq/CimMULWbDnOlAXVU3U/J9I/er8G19MF5hQqcbjB5odSbA7 IwOE/F1HZbs4ZvF5K528mmiM3z9jw2KbKeZ5WegaxpoUdI/HaWKRLJeTaLIFr2NYNGPgkFHt7FIOf P+pq/k2qbOJqj28w8HZwHXS4d2V3iRa/x+iRx0lDuGgfvB1UdP3RuT6bBYRHNxejvJABDLaBt2HvJ qYOdsk3w==; Received: by zero.zsh.org with local id 1sKjHw-000EDO-3c; Fri, 21 Jun 2024 18:47:08 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f43.google.com) smtp.remote-ip=209.85.218.43; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f43.google.com ([209.85.218.43]:48318) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1sKjHc-000DxA-I3; Fri, 21 Jun 2024 18:46:49 +0000 Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a6f13dddf7eso292853966b.0 for ; Fri, 21 Jun 2024 11:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1718995607; x=1719600407; darn=zsh.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DuUagwuGDTwE8LbLpyRgYKOrumyxUs/NF1MMpk+e27o=; b=wNK50ajkqy2pcxdK1hywUczX/5wsb+10nlnb+bsc0cG78qfNzDzjRJnU3586paF5np bfPsmn8tivBi6ElV3eLnBe0bd5z9lHW6SpNqFEVq1+RsLqJ8VbJvdS2mI8IefrNx5jps eJXjEdG7NmW45CCvC8IOnAwu4hRj9YIa51Nz8FcfcTcmFEVygBRg3h6TsDfldwRLpHlw 4V89RGi4rDe3dti0ZwqaOD/sM47ZLj3neISbCaKmHfsL4iACtOby/z0i3yfUAPF0uaRL 1zT8ltdYYpwioeKhPL5twdQHHk3gaX8dw+fTAIelQXywfvUvO0KZf0DDwXnRRBnGT8nq +OGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718995607; x=1719600407; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DuUagwuGDTwE8LbLpyRgYKOrumyxUs/NF1MMpk+e27o=; b=l5NcDKLV9tspbRtENb84wnDCcJVQFEcGH4AUJuH/K/QFhCPqrcgzQEvS5zUWKH0rCM jYMjV08h9D0fcclsN/5lCVJ9SuFfJYSFIe67KaYmhkWy3gLCvPHiUNgDkyAs2fF94QgR yliITb+PfYhi+Q6dzoqJ+ebvZ8vOcGEEyfCM1glTwnuqiyHXe6CcEtwppbqQvEBFT8Fx 4uhd6MzPQ8ZqhPOWCmxPvU9nzp3bt5pOZQfd/tksu/DphOINSF/ofLhcWO/MZp3a6NpS x1d3zcZ4aOVIe5b8MJBpJ77Q0nIC9cEg0RucZyouWuB3wyDoxxbmDMhfxbzPi5V7P5vL /6ZQ== X-Gm-Message-State: AOJu0YxRoZchEWKwCz4WLIXEBPk+KqLdC1aCU9VxhjCNu4vygnXG8YkZ nD80o7zLL3HwecyFgmdww1fmd2J5EE5FzLIK6DrM60ABUz4Yu61q/M1RGH/MG8QhbUmsC5BRjwU p1V0Tt1Mkd2J2FQorTg/VtHOzEaqcqgvRtTO/YkHwYe2shxI= X-Google-Smtp-Source: AGHT+IG/LQ4yTa3V8Hk3K1QM0kNa+Cto2DeuG3aPVg58vzYu1zS8kt+SLESfXUjhiZFAkiIwosSlOde1Kfeby7VqLkU= X-Received: by 2002:a17:907:7f0f:b0:a6f:9e2d:6b52 with SMTP id a640c23a62f3a-a6fab6096d4mr844125166b.3.1718995607499; Fri, 21 Jun 2024 11:46:47 -0700 (PDT) MIME-Version: 1.0 References: <5d54375e-8673-45f0-b5ac-f5e0e233d56f@inlv.org> In-Reply-To: <5d54375e-8673-45f0-b5ac-f5e0e233d56f@inlv.org> From: Bart Schaefer Date: Fri, 21 Jun 2024 11:46:36 -0700 Message-ID: Subject: Re: errexit and (Z)ERR trap regression To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52969 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 Thu, Jun 20, 2024 at 10:12=E2=80=AFAM Martijn Dekker = wrote: > > $ zsh -c 'true && (set -e; false; echo NOT REACHED)' # incorrect ou= tput > $ zsh -c 'true && (trap "print Trapped!" ERR; false)' # no output; = bug These two examples can be fixed by resetting the "noerrs"-related flags on entry to the subshell, although I'm not sure that's correct when the subshell appears earlier in the chain. Of course even then, exit from the subshell won't be treated as anything other than part of the boolean condition in the parent. However, given this -- > disabled for "any command of an AND-OR list other than the last" -- the question is whether the behavior should be the same when using brace commands instead of subshells: % zsh -c 'true && { set -e; false; echo NOT REACHED }' % zsh -c 'true && { trap "print Trapped!" ERR; false }' Certainly we don't want to reset the flag even on the last command when (for example) the AND-OR list appears in the condition part of an "if" or similar construct. Is my recollection incorrect, that there's a change related to this in the as-yet-unpublished next revision of POSIX?