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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17602 invoked from network); 21 Apr 2022 20:39:30 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Apr 2022 20:39:30 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1650573570; b=Mq5HgvhOt7ORwNkYG3MVgk0R0GIAIk+MFXbaiOBG4RD7WKNqb2sE+tVnkTHIXsN7qWfFuLaFvy urzfuprTyJGMBbq9lEaGo4u8bF77rlxNeUEHqa8RsyQUHMI5/RSCBrQs7co8frgh8uc4sLBuJs 16N25FbRfQvKugsueoI8UjOUOIuj99u//dlYOKFa5fIw93C28W3yY9sRji7iryKUGN7xLXzxx0 lurgA6fOwWakmI9VeRaQNvNLPYvz64czgVItZdfS1HVlg9mGFmioOgDDV6FroIcjvqGG4avz/7 /AtaDYTR6Cup1HbioZt4koXGTT0DOyuNWagndS+Z2wzUjg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f178.google.com) smtp.remote-ip=209.85.219.178; 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=1650573570; bh=1MCELnhnFZtnIYmVDV56jWVIdfFf0SEQlrezfeB7xGc=; 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=Hs5LLj2mV97/U8SxWJYuj+afD8RiepNguonybgSlMPMfSfk6F66Sj09S+7RUV8AQpK1jVky8d1 rxJanDwLc2ROwLMnYJdOHgxReOx8aR6vtF+cb7fAg/K4qOKJ+oa3LpGpmSeY9TWmiEkAlEZQOW ib1zpe3/ZcKIVYeqKMaPEODzYNotG4Z5tLOQkQxYGyVMtB5HrO3yKa3Z08ClCdg/ZKNL/4dgQp Zfxb6paIA1118C7jqpfFrPf3Y0K+QHt8P59BCV8zjDAChxrlcphw1MnZXZh0NAysta68Zd1Ran laheG+TlUb7hthVmRpK0QS9kaw4LaG78VyhPwQrE/FOyWw==; 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=otmjP3uJ70BtrfNLmlIymD/iSDSNeaOsNgeqOp8Tpf8=; b=Yh2lNxo05p1e2lXiFwzWGJKHfV yMFwPksdBlrj7S+8Rr4jejdeyGPmZDF2JRlb3yWiEm7IqplxMEq36NinDMitcoNglX9T9MNzJSYqt AITv5mdgH5s/zW5RnpY5pZJl3l0qLtDNvMUoQQXtXqSrJjt6VdtisQM7tOr7fl39EAiKLd5tbwwd9 gI3dno/68YOYgY7+ROFRUnoXdQ178FKb5k36zFi3T4ojBRn11xA+DLbbat7Hl6oObkNb691MmhFdb T+MaAaKpEdfghBAG9ZchwVtttS9ZW9+nPAdSsVcc/om0Ki6MzHeTVyimmjcH8CWKIkqvAeY9HL4XH xMKE3Vig==; Received: from authenticated user by zero.zsh.org with local id 1nhdaL-000Azz-8v; Thu, 21 Apr 2022 20:39:29 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f178.google.com) smtp.remote-ip=209.85.219.178; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yb1-f178.google.com ([209.85.219.178]:44591) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nhdZf-000AIZ-5f; Thu, 21 Apr 2022 20:38:47 +0000 Received: by mail-yb1-f178.google.com with SMTP id x9so3725917ybe.11 for ; Thu, 21 Apr 2022 13:38:46 -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=otmjP3uJ70BtrfNLmlIymD/iSDSNeaOsNgeqOp8Tpf8=; b=PM/7ZUJMEPZhCdKXjmcLqp5dJaN+2mMg+kBmFDfFhraoBCdvGvKlY0MNuiW1blMaJM fQFwuc0T6NUiD3ylLmyujrABGTBw1eGr8LIWPE/HlNHjUQ/zi5yHrXrKw6xOBwOk8Vw5 WLLxVKBeJqhF9TSPjpnUBrNadB5X6jlCbPORZKNbsBPwazrVZz7xjrehb28SEo6yfkAj 5i+oQmnd6l1wqiI/3suGMKtU6C90KQq+5us0bICzZLi+3dmaroM7djc62S7Y/lz6jvPc V7wBPua9hew3uTf1xk0n62DgBguh5gnmyqv4cAGqp6IH83JowyfVne91txZ/QmFbf3qs MWaw== 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=otmjP3uJ70BtrfNLmlIymD/iSDSNeaOsNgeqOp8Tpf8=; b=gJrYA1sM0wDL4OM+FVJ8nAzVyw2c3t9yYru6ysWxnKWAfMTYhZRrDZqUJreK8FLpAg JkHWtVddT6Ye36v42VnkzihK91xF7dOx7fZ5IuxXKYjmK/T+seXA9GBNGOtvAym0ATx1 f1PFgJDAJ4h6SoeYxurSzqr1TYjDFgiglj1yuL9DvObibXw91rgsnJ8dRy0nH8NVWwar BQz8yYScqzKo3b9Xmqp+FGbTBz0z6/IIpeGeRcaiYzwqvauLZzd+grjK/xZqhIjHJkQf T3BBbYhtQqlFWXqPx6HbNwCn79dXSmVpqTFS9RhG/krzZkvvS5oP/RoUeX19Jmll1rTV GFkA== X-Gm-Message-State: AOAM5327lYbFnvrOIpgcWoW8b1VLVovGz+B04CgRjJEjcGPRJRJbBJio crbsvUtGhGZwKipMdV4OfBjOloEPkVRq5/gxB0tHqJSeMFo= X-Google-Smtp-Source: ABdhPJydKdHJNmWAhzkSbVsPPZvhh94megPDArchEhUf3QGOhkdaN9U/LWPLHo1C43J/JHHqWOkLBNg6S0b4jMNgAtw= X-Received: by 2002:a25:9a41:0:b0:645:49e5:986d with SMTP id r1-20020a259a41000000b0064549e5986dmr1559250ybo.59.1650573525532; Thu, 21 Apr 2022 13:38:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: linuxtechguy@gmail.com From: Jim Date: Thu, 21 Apr 2022 15:37:11 -0500 Message-ID: Subject: Re: glob inside nested parameter expansion returns glob string To: zsh Content-Type: multipart/alternative; boundary="000000000000aa449f05dd3018a9" X-Seq: 27687 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: --000000000000aa449f05dd3018a9 Content-Type: text/plain; charset="UTF-8" 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 --000000000000aa449f05dd3018a9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks everyone for the responses.

On Thu, Apr 21,= 2022 at 2:15 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
On Thu, Apr 21, 2022 at 11:51 AM Mikael Magnu= sson <mikachu@gma= il.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
--000000000000aa449f05dd3018a9--