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 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 0723D25AB9 for ; Sun, 5 May 2024 08:34:07 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1714890847; b=LGC9/tf4XwIZD0H6PwDY8b/pF1KYQkb1AMdT/K4fMQueKNnU80nNxT5Kzvq5NYFIXgeOhgo+/x +2skFsV4utuzKTOoojrxt4t0SR8dvl2gYKoHksHDkqmXAn2tpbxwtXAbeiz88UcGWZVSIcfIWP 39u7jYMeFRe6RlLSkrLt5oasKBGLcPBfYXETAo4gJpEzFiwi2JUnBCiry3bBiWpYbXQXHO+OjB wm39C8YIpGlNOuCg8nxjPvK7QU4hO3MlRdlu6WYjoXWagMRu+uQFk++17+Vw97/clt79ocT5YL LH6NV8pubVkjYxfnMtj4goMVeyLj46/sdN1Sl8dI+mWRPA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pj1-f53.google.com) smtp.remote-ip=209.85.216.53; dkim=pass header.d=awkwork-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=awkwork.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1714890847; bh=AWdEmVB/uBvOdnZzN9n4YdcgS/LOV6uZr/ohtblAyz4=; 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=mJCAz7XEYyIVqXppsBTLq2OGMAJfZ8MHZzJGdgOqGXRzsomSNY0WCeC9wTIyodLuuSk4czMYYh 1L+Lv8ERiK02NZ1Bx++4gdhzQF0Czi6wrBevXQE0UgmWALC+lojrCxrp27l9zgzD/9zQSocrkC iBWKoMBwU+9jnT/xOzj3qj4+H1Bsha4HzV6pp1pyS8dNWosPOhA6AzsaVMrMVlslm09TW5COzJ qTNEvjx1heTz6q3alCxIgE1/mb0/9pAa5W1ErA07Vq2zw4Mmbq5T1/g6djgpNYA/StQgvLxwMQ /YURsvdMXKcaTyypkmO/jUXodys+36W9kGB6eLidvdbEBA==; 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=quj6mrxD8ik1voC0Kr1Qug7fe8bVf4ciknfBHowy91g=; b=FE6VvThcpyBctOj0ly6stg7Nui RtcNKsw0EZ2SNgUl2o3HSqVzyBpZ/82XC/Odr+cTpA0jkaW58JwsbV+LRLGL2XNgusDbdKiGe6vqk NBfdN7u3l59j0QXZ9hlVKel+2TSSBPJU1uVZIO5A2hyoXedHZvyxzQlnrzQ29euJDhlJVo67j84pQ ke/siQnc/bWc/u69bLPG7F1Sv4nbHGyuS/Di65+6u8TV8GL1GGcY5SjhN3oLv2OsvA6Lue6NoFNut m8M3PGDwjADfEqm5Dg+k3z9mAOWdKdm9atYuTwY5b/pf7/0zEJyypXUUgeXJrcJ+YVRqKMqfbhlcK c6Cql6vQ==; Received: by zero.zsh.org with local id 1s3VRn-0003RV-PQ; Sun, 05 May 2024 06:34:07 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pj1-f53.google.com) smtp.remote-ip=209.85.216.53; dkim=pass header.d=awkwork-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=awkwork.com; arc=none Received: from mail-pj1-f53.google.com ([209.85.216.53]:48359) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s3VRS-000375-Nk; Sun, 05 May 2024 06:33:47 +0000 Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2b33e342c03so942707a91.0 for ; Sat, 04 May 2024 23:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=awkwork-com.20230601.gappssmtp.com; s=20230601; t=1714890825; x=1715495625; 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=quj6mrxD8ik1voC0Kr1Qug7fe8bVf4ciknfBHowy91g=; b=oUF8m+yK7LTFizUYu+5M5VaHKwqSkyWRQJPC1UBlG/7wcSaYYvXukcimyG2UmgLFi/ alrxeNWouejEg1RQ5fLVRtocUsGtoPkW6bZTVXbSRI3xFgGmOqrz0l0H53LrZ+8n4/Aq Y0DaiRsCSgG6JJPKQUfQhLrANtn5Kef6Iav2khzxeMUB9gXcydQJVvH+9DZFcMekIoQI emU7fTa53hMyhDQgcFLMFK/6KSC1bxGSPn1EJ8pebTuTb8EbH2W6/bTURLwC4s3XezaH bnzQaMdVBvaMF3Efsr+Uv4L4hgOpWr2QFUgTwDjiMlK9rfi/iyCjUQPcnfK2T6sZleao aoJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714890825; x=1715495625; 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=quj6mrxD8ik1voC0Kr1Qug7fe8bVf4ciknfBHowy91g=; b=xONPOmlnwmPytRTEpf0vW0xYV5zoh6MY0p39YFc3y5QZaDY4qiO8e5MWzJpkgQj+F1 lObyPqPCEXeDTZic7A/B7OX1PGGHsfLq9E+qjCWmeM1UemsNa6UoS80I6MkJGlR+0bcy 3WWl3TZscfI6z96kf2mW2IhUbAGsmtyOBdnEEZ+GA6zrKWNtvG6VsoRrtsa+rR3jQkO7 xOWXUlzgbd7rKychnOnk+Mf53UDLFDo2v7q5Zk5q5+sYePhkprS7UPZmFtsWJtWPUkj4 cX6OIyPU0c/jB/r02lpPNscXsCzRJZ//sKfpT440aWFERf2b7IBWQ/cSvXGS7q7dfdTG TMEg== X-Gm-Message-State: AOJu0YyWmSb7q0FB1EoRpbiJxdqTACE9aoSdLGx9ylwPDVX3CljnjxDX jorP/Hf4O8wwDihRaNjg7pGQgkqLQvBXmRUAvsVGZXTmohGMcSaoPtPCp7SpWedden2iLRrcZIY r+oKmix4SPfW5LzfhLnb+oi1Hbb+Q+BmEep3h7g== X-Google-Smtp-Source: AGHT+IFCEuZvJR7uonBoD5vG609IQy35z5sM7Nap0TxKmsWYwxLqHt09PzehyKGJ0LXKxMtqCpoF4116kPWDAq/MKok= X-Received: by 2002:a17:902:da8d:b0:1e9:cf94:5bea with SMTP id j13-20020a170902da8d00b001e9cf945beamr10084787plx.35.1714890825384; Sat, 04 May 2024 23:33:45 -0700 (PDT) MIME-Version: 1.0 References: <1388695268.1045346.1714552728211@mail.virginmedia.com> In-Reply-To: <1388695268.1045346.1714552728211@mail.virginmedia.com> From: Alan Wagner-Krankel Date: Sun, 5 May 2024 01:33:18 -0500 Message-ID: Subject: Re: Inconsistent behavior with comparisons and recursive glob patterns To: Peter Stephenson Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52914 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: I think there's some risk that "... '*' may match one or more '/' characters" could be misinterpreted as "... '*' may *only* match one or more '/' characters". Maybe: the patterns `tt(**/)' and `tt(***/)' behave the same as `tt(*/)', i.e. as a standard wildcard tt(*) that could match any set of zero or more characters (including `tt(/)'), followed by a `tt(/)'. Thanks, Awk On Wed, May 1, 2024 at 3:38=E2=80=AFAM Peter Stephenson wrote: > > > On 01/05/2024 08:55 BST Alan Wagner-Krankel wrote: > > Thanks - I did miss that **/ wasn't supported in conditional expression= s. > > > > I wonder if there might be some value in making that explicit in the > > documentation, possibly by changing the paragraph you referenced to > > something like this: > > > > Pattern metacharacters are active for the pattern arguments. The pa= tterns > > are the same as those used for filename generation, see zshexpn(1),= but > > there is no special behaviour of `/' nor initial dots, shorthand op= erators > > such as **/ are not converted to their expanded forms, and glob qua= lifiers > > are only allowed for forcing filenames to be generated as described= above. > > > > There's a slight issue that "such as **/" implies there are many > > shorthand operators; I have no idea if there are any others besides > > **/ and ***/. > > That's a sensible suggestion, how about this? Please do comment further. > > pws > > diff --git a/Doc/Zsh/cond.yo b/Doc/Zsh/cond.yo > index 000e576..4216f89 100644 > --- a/Doc/Zsh/cond.yo > +++ b/Doc/Zsh/cond.yo > @@ -241,7 +241,10 @@ ifnzman(\ > noderef(Filename Generation)\ > )\ > , but there is no special behaviour > -of `tt(/)' nor initial dots, and no glob qualifiers are allowed. > +of `tt(/)' nor initial dot, and the patterns `tt(**/)' and `tt(***/)' be= have > +the same as (*/), in which the tt(*) may match one or more `tt(/)' chara= cters. > +Also, no bare glob qualifiers are allowed, though the form `(#q)var(...)= ' is > +allowed as shown above. > > In each of the above expressions, if > var(file) is of the form `tt(/dev/fd/)var(n)',