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 24799
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: How to overcome the (a/b/c…)(N) pattern limitation?
- Date: Sun, 19 Apr 2020 07:44:56 +0100
- Cc: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAKc7PVCJfCwUUrm5KXzzehxuX1JF=Bvwkh=m7we_TiCrtw_fhQ__30396.4317821496$1587217473$gmane$org@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>
- Mail-followup-to: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- 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__30396.4317821496$1587217473$gmane$org@mail.gmail.com>
2020-04-18 15:41:37 +0200, Sebastian Gniazdowski:
> On Sat, 18 Apr 2020 at 14:56, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
> wrote:
>
> > On Sat, Apr 18, 2020 at 2:51 PM Sebastian Gniazdowski
> > <sgniazdowski@xxxxxxxxx> wrote:
> > > I was trying to do: ls (/tmp/somedir/gh|./gh)(N)
> >
> > This should work:
> >
> > ls {/tmp/somedir/gh,./gh}(N)
> >
> > Note that you'll get listing for the current directory if there are no
> > matches.
> >
> > Roman.
> >
>
> I need the technique to be pattern-based – it is used in script in a
> $~pattern way.
[...]
Use an array:
pattern=({/tmp/somedir/gh,./gh}'(N)')
ls -ld -- $~pattern
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author