From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 27146 invoked from network); 18 Apr 2020 14:43:35 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with UTF8ESMTPZ; 18 Apr 2020 14:43:35 -0000 Received: (qmail 17824 invoked by alias); 18 Apr 2020 14:43:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24795 Received: (qmail 333 invoked by uid 1010); 18 Apr 2020 14:43:28 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25779. spamassassin: 3.4.4. Clear:RC:0(209.85.217.54):SA:0(-2.8/5.0):. Processed in 2.172239 secs); 18 Apr 2020 14:43:28 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.54 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O3Lj6exQxCuJnC8wzm8zCfBz5JxCKa1YmF3O7WGXbMs=; b=CsiaIDOuCEFquCIuAprXDHZuzaMJ5FzS/14AgVcVn4hIgrpK0VFahhi49Wq1fjGtbd A2t1bxoJerB9ZB0o5xfLpm8yD6Mlk1MN8ZYjsGud2HRrUS/deV7PMgL4w5aI22OOqLwg fJfnlkPdXQbplrjDfLqhIw8SSDOMjXe46A0XAse3vCleH8J6Tsmr07Vxqo8l+x4L/YYT QfIY40cHFLWO46yiCg9oq4IRyoaNjsTjQasctMMra46Sczb9hzjNqJPKlysETAe5Xt4d Pncw0Ak56ttkDkPVuM/9CFwxEAC7O6gKRCSaBFUcrx3MjNogQqhrIgNJheLZSnetyDae XoCA== X-Gm-Message-State: AGi0PuYAyfkA0Z+Wy24Tz9LRbafODJiB1CGwmpFwPgWBMwSr769lkKuB ILOBoJZgek04yDqOrzzqGA92c20Lzz84W+x/c7w= X-Google-Smtp-Source: APiQypLl9oAWLAmTekt9fyYwX/S2gz4bCpha0dw0Fk8B/2tStlx1I/AEDMQ+K9lwpHuE05BJBfhcpQR3XyOKl9wtlxo= X-Received: by 2002:a67:1582:: with SMTP id 124mr6125732vsv.113.1587220973170; Sat, 18 Apr 2020 07:42:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Sat, 18 Apr 2020 16:41:13 +0200 Message-ID: Subject: =?UTF-8?B?UmU6IEhvdyB0byBvdmVyY29tZSB0aGUgKGEvYi9j4oCmKShOKSBwYXR0ZXJuIGxpbWl0YQ==?= =?UTF-8?B?dGlvbj8=?= To: Roman Perepelitsa Cc: Zsh Users Content-Type: multipart/alternative; boundary="00000000000049365f05a391aea6" --00000000000049365f05a391aea6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 18 Apr 2020 at 16:31, Roman Perepelitsa wrote: > On Sat, Apr 18, 2020 at 4:08 PM Sebastian Gniazdowski > wrote: > > pick=3D"(/tmp/gh|./gh)" > > list=3D( ${(M)~pick##/*}(DN) ) > > I'll simplify: > > pick=3D"(/tmp/gh|./gh)" > list=3D( $~pick ) > > This doesn't work because $pick contains slashes within parentheses. > This isn't allowed in file generation (with one exception). From the > docs: > > (...) > > Matches the enclosed pattern. [...] > =E2=80=A6 > Yes, but as I wrote, such patterns are useful, good ones and I'm looking for an alternative form for them. Also note that ##/* in your example is applied before file generation. > The effect of the complete example is thus equivalent to this: > > pick=3D"(/tmp/gh|./gh)" > tmp=3D${(M)pick##/*} > list=3D( ${~tmp}(DN) ) > Yes, I simplified the case again, the complete example is: list=3D( ${(M)~ZINIT_ICE[pick]##/*}(DN) $local_dir/$dirname/${~ZINIT_ICE[pick]##/*}(DN.) ) It matches either the absolute path given in pick, or applies it inside the local directory. --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit Blog: http://zdharma.org --00000000000049365f05a391aea6--