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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 6A20D2011B for ; Mon, 25 Mar 2024 18:36:45 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711388205; b=RKhDpQrdmSlrElBn0yFSSITPYPpyZyp3RD/Y5KoXSbKWmzbYNpdoBjiMGhwYGMIZQw5kpqgK24 kCM9A/soec5wuZTeLDKWVSObXq5vZlsLxQT5wDZKjh4qQQ9NtPQd4HSbsLkRtIwkFvBPlED3NC 0xr+Z9dgKLaA2Mk3qm3EP0PguT4cN3Ccza+L7PDEwV0mCIBOHyXGH4tG2Qaq21OpWFb8uQluy6 qfKEuErdln2vJuYexkNcOWYlQAHt6z5zH1KMLWU9ESi6of1tIWUDHqCa90/pUa1tpufcjULfTy 8EmI0dligkRMrsRm2hYXw/gqXqdY4As7su99/FZZ6sgRoQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f43.google.com) smtp.remote-ip=209.85.208.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=1711388205; bh=WLyDs70hUkRpAtfO/tkQskYzCZENeSPy65DndoCw+PE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=a6yw1V7/iFhqXrv+FFpyEb1HmixJXyx9fIvYkNj1PpwbI7O3huKNaNlbk5KDs62VTMJI1ONTHy tbZlCseMraBv1JJWb6XR00rb8uvEhAYR2ZekkUldSrxdITFmI9D1jk8bXFiHNZcwh+uqk3Sq2x 1lYWy93U0qvKAJ1uRzAe/KKsthX9Npzomu821K1+RJXW9RL6fgWgxMJVgFQ5x4oNjDbThtNShl G/f1AqwdURupEwBCBFaGSfAnRcnXKaF3k7Fj7aPF1R7LiOWSs7XuxAZRvtFEO/IoXZFjckT7W+ ZuFmFdMt+DIFsI0gIKlMZMSPkueRDFF1EfSuSo3UxYMcFQ==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=t9L1l8tT9bFeM4Ms+WDT5GFi5Rl3YguK6BtJQ/mKOZ0=; b=YiB0T9kUJb15ftvJ57cMkBYeSS acggfCVpBjZ7zDT34aqCPWUPP+8o0o65JaInZ/WDZmoIA80Y44I+LkukrkriK0VwLyb7cQS4Tbmhz ie1Y+4phuhqZiY+qio4HIaPBwgjOF0edeK7/xxacmb7VjeEmzTrswq4K7viG+bHE83NFYCVzInrN5 91oH/boaBbd4cMpz8fx5jOTnoFVqcDm5CoiUlRw50ubxeJ88BGjWPGyC6qaywSp3fqJGQ56nFuBQI 6fVGGW8NjFTNuvO4bGYeO0LLKpT3WL4eyjiX/MHK3tialbNnUd4YpFMvk0in9GLrDal+3ApYIxoJK nK+UstzA==; Received: by zero.zsh.org with local id 1rooFZ-000OwZ-66; Mon, 25 Mar 2024 17:36:45 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f43.google.com) smtp.remote-ip=209.85.208.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-ed1-f43.google.com ([209.85.208.43]:50284) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rooFF-000Oby-0k; Mon, 25 Mar 2024 17:36:26 +0000 Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-56bf6418434so2751489a12.0 for ; Mon, 25 Mar 2024 10:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1711388184; x=1711992984; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=t9L1l8tT9bFeM4Ms+WDT5GFi5Rl3YguK6BtJQ/mKOZ0=; b=TZ/3jfNNHfj9o8WL1SHIKKDwTuvdFiUYYdj/yvXYiqpw+iwW8Of+lqZfDGLMHuQquF ATSOAFEov1iyS4N/oxkdbMAd3a8kV+mD68eERvvXh/S0qpXY0I83/V90b2BnVKxMoVGT lj7uN3GqfQ2/2NBe2RfPfwaMOpoi3J7db30Jl+GQD+7EMfAcYWbAAgHNUNDGMqSiJicU MlpRwPHHrcp7bgjl2h7logRvJrjd0RsW8hI9N0YOOXDK+OEBWVmAvXPMHuhR+2JrJmN5 BI2dwJeGEwBXppc76xFEQjdb1gM4D2URY1vyxY3HIkNQAv0LfQ8n6128Xk6wiDSHvW2v LU7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711388184; x=1711992984; h=content-transfer-encoding:cc: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=t9L1l8tT9bFeM4Ms+WDT5GFi5Rl3YguK6BtJQ/mKOZ0=; b=Tb+AvMfP5347zxuJsmc/N16yIYxdIfaBSDF+MbQUHLw/QL6NBDnzpWomSnlbuf1Zim lZmcXLh+qew4jmA6BeHbm0u5tu6UjPX67/tSAnEbs8IvvQkggrkRUOu+2wQUkJ69l8XT V+jbbVFKq6Rop1qEtOwYtU6L+2L3BVELvNJD86UkFIFtJqlLVql6eZiKs+Ie6U4Sp325 5VUmGH7nNBz6Q4Z95Jw+exXCHBU4K1y4C7yiSIIO4/MsBluNubY2p/dG19AzKaXIPjHe X1yMPYXrMghfg4K77VHH1qmONnG7TJFRF0KAUJpZSCfcGiYs+xU4nmx+Rt9FJzERYzyy djxg== X-Gm-Message-State: AOJu0YxHMTj3/2vzaUQN64BhhqAEJVRQwuvdk545LDe1fKGzGGxjx+rt /tXOAJj33GdJGGrRdguB68YDpJHQUb49JixlkAllmMVeRMoWTDgBEhPRT8FsBuSthdITDZpdl5V ouvgfN12XHicgjxdldNdjnynhp0/tBvjANnYM X-Google-Smtp-Source: AGHT+IGFxeOdYBF6gCqCf46lJYh3S7n1yFwjne3ezE9NLkyTM7+puq+b4vkuKfnFZn//KSn3UoFVQC2+5hHc5Mtipww= X-Received: by 2002:a17:906:32ce:b0:a47:11c1:92d7 with SMTP id k14-20020a17090632ce00b00a4711c192d7mr5321131ejk.69.1711388184475; Mon, 25 Mar 2024 10:36:24 -0700 (PDT) MIME-Version: 1.0 References: <20240321100710.GA164665@qaa.vinc17.org> <1443395979.5911218.1711016896863@mail.virginmedia.com> <20240321110444.GC164665@qaa.vinc17.org> <1507569659.5899391.1711020579178@mail.virginmedia.com> <1255066524.6153675.1711384714319@mail.virginmedia.com> In-Reply-To: <1255066524.6153675.1711384714319@mail.virginmedia.com> From: Bart Schaefer Date: Mon, 25 Mar 2024 10:36:13 -0700 Message-ID: Subject: Re: behavior of test true -a \( ! -a \) To: Peter Stephenson Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52815 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 Mon, Mar 25, 2024 at 9:38=E2=80=AFAM Peter Stephenson wrote: > > > I suppose as long as we only look for ")" when we know there's one to > > match we can probably get away with it without being too clever. If > > there's a ")" that logically needs to be treated as a string following = a > > "(" we're stuck but I think that's fair game. So in other words you're intentionally breaking this: % test \( ! -a \) \) test: too many arguments In the name of "fixing" this: % test \) -a \( ! -a \) If we're arguing here based on spec, POSIX says the below should return 1 because $2 is a "binary primary" which takes precedence over parens, but it's broken with or without this patch: % test \( -a \( test: parse error To be fair, /bin/test on MacOS and /usr/bin/test on Ubuntu both choke (or not) in exactly those same cases. > Feel free to argue that the current behaviour of simply parsing > parentheses in order and blindly trusting the result is actually a > better bet That's not how I'd describe the current behavior, but I'm arguing that it's no worse and anything with more than 4 arguments is unspecified anyway.