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.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 CABF12159F for ; Sun, 24 Mar 2024 00:34:18 +0100 (CET) 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:To:From:Date:References:In-Reply-To:Message-Id: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=cRZqRUGtBE5ktdibECtdV1sG4EtO8ijGIAI4Iuyclb4=; b=CStEegTnzq/bx9YhbIdepQ7BsJ eO594TxBjny3OOW/QIY28Q42a7PWecxOSKycLUwbVgMqvPM5T1nQIunfe5r1M+rpH9TyQmWQn1w7j pzF5ASkP0WiQXuN5T8fFhKwHSjigiqI/Qj6m7sYczy7ypVId/HngWbXUU7O2tZSbXUwDpMwtRgc5a lHwuxd12pclB7OWmYnVt05jM4AtklT/Qjrb5BhayU53Ws9Cx/MSTq3wQBB5Jx6CHFAQpRhzCXSdxr SaK9zGixFzjOaxg/CQRZ/4d5HEe57lpKMjzzRXPpYqZVVYEZZP2UmYjIYrBwzKSH7aQhgorxorAsD JOAj5+4A==; Received: by zero.zsh.org with local id 1roAsU-0001TQ-4H; Sat, 23 Mar 2024 23:34:18 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1roArs-00018Z-VA; Sat, 23 Mar 2024 23:33:41 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfauth.nyi.internal (Postfix) with ESMTP id E026E1200032 for ; Sat, 23 Mar 2024 19:33:38 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Sat, 23 Mar 2024 19:33:38 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddthedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtgfesth hqredtreerjeenucfhrhhomhepnfgrfihrvghntggvucggvghljoiiqhhuvgiiuceolhgr rhhrhihvseiishhhrdhorhhgqeenucggtffrrghtthgvrhhnpefgffeghfehjeegtdeitd evgeehgeehjeefffeffeefieeguedvtdegtdetudeufeenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihvhdomhgvshhmthhprghuth hhphgvrhhsohhnrghlihhthidqudduhedukeejjedtgedqudduledvjeefkeehqdhlrghr rhihvheppeiishhhrdhorhhgsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: iaa214773:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7237531A0065; Sat, 23 Mar 2024 19:33:38 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-332-gdeb4194079-fm-20240319.002-gdeb41940 MIME-Version: 1.0 Message-Id: <81df9600-a0c4-4c7b-a4fb-f61106395b96@app.fastmail.com> In-Reply-To: References: <20240321100710.GA164665@qaa.vinc17.org> <20240323222036.GE164665@qaa.vinc17.org> Date: Sat, 23 Mar 2024 19:33:18 -0400 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: zsh-workers@zsh.org Subject: Re: behavior of test true -a \( ! -a \) Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 52805 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 Sat, Mar 23, 2024, at 6:41 PM, Bart Schaefer wrote: > On Sat, Mar 23, 2024 at 3:20=E2=80=AFPM Vincent Lefevre wrote: >> >> On 2024-03-23 14:48:36 -0700, Bart Schaefer wrote: >> > I'd therefore argue that it's actually >> > >> > % test \( ! -a \) >> > >> > that is wrong >> >> POSIX specifies what happens with up to 4 arguments. The next version of POSIX will only specify what happens with four arguments if the very first one is "!". The "-a" and "-o" primaries and the "(" and ")" operators have been removed. > Ok, but > > % test \( ! -a \) \) > > has five and > > % test \( ! -a \) -a true > > has six, and in neither case are the "first four" interpreted as you > would have the "last four" interpreted in > > % test true -a \( ! -a \) > >> The idea is to >> interpret the operators in a way so that the expression is meaningful > > The only way to do that is to (in effect) start counting arguments > again when \( is encountered. That changes the meaning of everything > with an open paren and more than four words. At what point do we > stop? The current version of POSIX leaves test(1) behavior with more than 4 arguments unspecified but says that: On XSI-conformant systems, combinations of primaries and operators shall be evaluated using the precedence and associativity rules described previously. In addition, the string comparison binary primaries '=3D' and "!=3D" shall have a higher precedence than any unary primary. I suspect that the Austin Group gave up on the whole thing once they realized its general intractability. --=20 vq