Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to overcome the (a/b/c…)(N) pattern limitation?
- X-seq: zsh-users 24792
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: How to overcome the (a/b/c…)(N) pattern limitation?
- Date: Sat, 18 Apr 2020 16:07:00 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAN=4vMp3+RqyoHi2ZUomxxMxS26KP_7fjrN5zVOeKfrhUSuecQ@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVB3rrKq6xT58fK4m1Bs_LUkA5wMKGvM8-G_5aJaBe6xTg@mail.gmail.com> <CAN=4vMrEn-j3Y=mZcLOkPwN6Hbq-oLxJ8yXD9JwQKJadEbtmxQ@mail.gmail.com> <CAKc7PVCJfCwUUrm5KXzzehxuX1JF=Bvwkh=m7we_TiCrtw_fhQ@mail.gmail.com> <CAN=4vMp3+RqyoHi2ZUomxxMxS26KP_7fjrN5zVOeKfrhUSuecQ@mail.gmail.com>
On Sat, 18 Apr 2020 at 15:45, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
wrote:
> On Sat, Apr 18, 2020 at 3:43 PM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> > I need the technique to be pattern-based – it is used in script in a
> $~pattern way.
>
> The first example you posted was helpful because it was clear from it
> what you want to achieve.
>
> Can you post another example like that, one that cannot be fixed by
> replacing (|) with {,}?
>
pick="(/tmp/gh|./gh)"
list=( ${(M)~pick##/*}(DN) )
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author