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,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20723 invoked from network); 21 Apr 2022 21:02:58 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Apr 2022 21:02:58 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1650574978; b=E93pV+36BAC09mOr4+31CZauwgwJpGD8XqJQYzAOidO4ND4iUlJT0/AXkRtgFIeypFUTAtctN1 CX0IsHTKyN0jCFZugEqmR0yM6qFLNvOhMQ/woDVh7z2dWukZFASiDO31z5QbVCRzeDFeth/FPG C3qNmfEjiQdU+Xm6hQrXMT8G7CTk7uLn86ZMZo4SVAL3UqFdceJkda3xm0kmbNgvTtXjydDCUQ 3Y2QR5QjbHw203+TWkgpVRLEYwlHGRBWtmrgootjtNA3uQPvxgwD/ACB8YSA+TVYrSsA2qSBTR +xS2Abuvs+mwnLC9VE6ISdtGcx5XN8mZ8HXab3NNOhKe/g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yw1-f173.google.com) smtp.remote-ip=209.85.128.173; dkim=pass header.d=gmail.com header.s=20210112 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-20210803; t=1650574978; bh=UCglcW6jIHhmdL2I8sJfmytenvdruuA24WGre4l1tgs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:Reply-To: In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=IalN+J65qchSzJD8iSFiCRuo9ZlM4l42H+/FvJi4KxKA+PU2+fJwnk/6xXX7HqzVnXHzfX2a+L 6E98248tPmWGM6UIXnpA8/bE7OlvkzX0SxRNsogy3UmpDYRTnd/+g4keere8pDJkWBm0rOOVbo b4JYYpPrF+W9mSeExOEe8zE6uQ5Od90pza5AKBkZM5I2NhzB0DoTqhr1B3qkvYPEsDTflHusRw ZHKBPl7m5a+hEUVNqSrca1IGoiYvzT9VG2wIgB1+LK1KILo0Zwd5sq62unW7AAM4BD7LDeipo+ 8Me18LYZwLNrVb5ia6reHsNXyqjU+uihrmiuI2+DBWnLlQ==; 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-Type:To:Subject:Message-ID: Date:From:Reply-To:In-Reply-To:References:MIME-Version:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=P3O/xId7uItG7CWIpO5FhCx/huI3Ozik+sCkh7t0Phc=; b=i3l3Y99OqK6YO8owyKH+WIptki AD1bStYlR8+JXehXYuNj/Ub00QCJpU8u8raW/RADfSbvfLJvqyGT4tQ5+fkBKAq6ccmeX0YPhXuMO 4u/axvHUjgeGBOYcKerSLh5bF3aVppuTMGcCkyrxriKAbmyRQr8iyMGhF/WVvjL35ieGW9oBosWXP 2q0I9BZKFt3MCRqx2qWvvbIyZFA6I3Iqn4mWV+YOz9++/Waz6N+LQeK3B/O71GmiWJuHPqYqt3muf 1cOGInZc2X4GmIn9ys+NBKoP0N+Z+ZGg9HTRqIxogMqv7+lnw1onYrmX+ELjn6I/7N/adABZ80aSx UwYeTztA==; Received: from authenticated user by zero.zsh.org with local id 1nhdx4-000Cgu-50; Thu, 21 Apr 2022 21:02:58 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yw1-f173.google.com) smtp.remote-ip=209.85.128.173; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yw1-f173.google.com ([209.85.128.173]:35444) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nhdvy-000Bys-C1; Thu, 21 Apr 2022 21:01:50 +0000 Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-2ef4a241cc5so65700827b3.2 for ; Thu, 21 Apr 2022 14:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to; bh=P3O/xId7uItG7CWIpO5FhCx/huI3Ozik+sCkh7t0Phc=; b=jk36xMoQzVenH+jjdr2jfmYWiaMahK4bUoZHIOBQyKykI7QeukFRvA+aB+yXCXe35D Zv1xeSZgMGUEVyHXN1BmTmtEIsGHgnOoT+tIw0NzVzWgf3ZyV+6HsFn3o/m7oTymMTxP eeAa/QWpUchRGFdSp6vN/vHkCr4BoNRc7rpfbW36qVhQo4OMjRB7atw3WEFZJRGH4cOf 0Gpkx1d9Wjmt6UVq0+Xs2PoYRZjgWpSWXZzy9X/3GieNQ4qFqSfoxb3pQfSu2TwXF+0P mMobkTWpmpWtNpGtrdgBLGnQFhlVhWn9+CrvHZYrFjRjVoRJBa1UeqTGAjX10SnMyd0y Vc+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to; bh=P3O/xId7uItG7CWIpO5FhCx/huI3Ozik+sCkh7t0Phc=; b=TR219yyoQWTVn7t4BqKGDaNpxTZ50DNx+7ukzTeSK1RbW8I+My2hAzxxTfKBqQKSGt LDD8ay9u0zmGWkE5GJw+ilfgmHx1KJJPdZhFAIymt7dgoCT5z6ykDxLq1GCfX4XamOhS CxzCw40W6mM0t/fnsNw1LqbwuYnBKJC/GjwzBnTyDcEhfHTO6H5xNd/FPo01K9dYgey/ LR4Tw9akJ4yhM9OttUBb8rJSsrIqnxkyY1jxxxUK05ou8C2QCtO9nmKiyMSCN6YVotXL QPQCoeEjSReL13vn4wbQdnWN1O19k8UN5tt1Mhbn9TasQHg0RxCfWf+lS+hf2gNQfw62 +b9g== X-Gm-Message-State: AOAM533Cq0Sljs+Ew8EKzibXDEKT00JtIlgkhdeUypZFt7Yd3hAwaTQh pamF92B0PE0dx4pjfIAETdtX+oyDGo+bIu0jvAUCvDZv X-Google-Smtp-Source: ABdhPJwXEsDu+eYkiPp5gMLgUwdTQ4pLIC8Uims/d8DwJA80EeJ/Uy9Qe8k7ztaCtvWt4W2TLYH5P88TkwiXPJgV1es= X-Received: by 2002:a0d:f0c3:0:b0:2f4:d291:9dde with SMTP id z186-20020a0df0c3000000b002f4d2919ddemr1711547ywe.437.1650574909137; Thu, 21 Apr 2022 14:01:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: linuxtechguy@gmail.com From: Jim Date: Thu, 21 Apr 2022 16:00:15 -0500 Message-ID: Subject: Re: glob inside nested parameter expansion returns glob string To: zsh Content-Type: multipart/alternative; boundary="00000000000022644605dd306b9f" X-Seq: 27688 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --00000000000022644605dd306b9f Content-Type: text/plain; charset="UTF-8" Sorry, thought I had extendedglob set, works fine. On Thu, Apr 21, 2022 at 3:37 PM Jim wrote: > Thanks everyone for the responses. > > On Thu, Apr 21, 2022 at 2:15 PM Bart Schaefer > wrote: > >> On Thu, Apr 21, 2022 at 11:51 AM Mikael Magnusson >> wrote: >> > >> > On 4/21/22, Jim wrote: >> > > >> > > % A=(${:-.z*(.N)}) >> > > % A=(${A:#*(comp|hist)*}) >> > > >> > > Is there a way to nest the two? >> > >> > There is a certain order that parameter expansions and globs happen >> > relative to eachother [...] In short, no(t as far as I know). >> >> Correct, this can't be done as a nested expansion, except by invoking >> a subshell to perform the globbing. >> >> A=(${${(@f):-$(print -rl .z*(.N))}:#*(comp|hist)*}) >> > > Came fairly close on this one while trying different ways. Didn't use a > print > command. :-( > > However, with extendedglob this specific example can be done entirely >> with globbing: >> >> A=( .z*~*(comp|hist)*(.N) ) >> > > Is there a typo or something missing here? This didn't find any files when > I > cut and pasted it in a shell. > > ZSH_VERSION 5.8 > ZSH_PATCHLEVEL debian/5.8-6+deb11u1 > > Again, thanks, > > Jim Murphy > --00000000000022644605dd306b9f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry, thought I had extendedglob set, works fine.

On T= hu, Apr 21, 2022 at 3:37 PM Jim <linux.tech.guy@gmail.com> wrote:
Thanks everyone for the = responses.

On Thu, Apr 21, 2022 at 2:15 PM Bart Schaefer <schaefer@brasslante= rn.com> wrote:
On Thu, Apr 21, 2022 at 11:51 AM Mikael Magnusson <mikachu@gmail.com> wrote: >
> On 4/21/22, Jim <linux.tech.guy@gmail.com> wrote:
> >
> > % A=3D(${:-.z*(.N)})
> > % A=3D(${A:#*(comp|hist)*})
> >
> > Is there a way to nest the two?
>
> There is a certain order that parameter expansions and globs happen > relative to eachother [...] In short, no(t as far as I know).

Correct, this can't be done as a nested expansion, except by invoking a subshell to perform the globbing.

A=3D(${${(@f):-$(print -rl .z*(.N))}:#*(comp|hist)*})
= =C2=A0
Came fairly close on this one while trying different ways.= =C2=A0 Didn't use a print
command. :-(

However, with extendedglob this specific example can be done entirely
with globbing:

A=3D( .z*~*(comp|hist)*(.N) )

Is there = a typo or something missing here? This didn't find any files when I
cut and pasted it in a shell.

ZSH_VERS= ION=C2=A0 5.8
ZSH_PATCHLEVEL=C2=A0 debian/5.8-6+deb11u1
=C2=A0
Again, thanks,

Jim Murphy
--00000000000022644605dd306b9f--