Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: glob qualifier on intermediate directory / no symbolic links
- X-seq: zsh-users 24083
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: glob qualifier on intermediate directory / no symbolic links
- Date: Sun, 21 Jul 2019 22:56:59 +0100
- Cc: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>, Zsh-Users List <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3iup//PZaCxlNrQIZyZpA7SgrmjPqsPMlQ2+AJD4KAM=; b=I2s84knV/DWITbS5V/C0GL7LO7r5/UORs37CLz/9+dpnWLuM3vxq5l3HwrwMP57WtX 9bFPCFLtyWiuYqfMDGPCsSHYSif40Sd68Q2VrwPjJAt40Y7G2dMaf8CSE9IAikRB0I8r 3T1ptbEmv4vVOQUg28I5ngZFdQTyPeTyiJTsdemhYQ0QJ6VgYfQn+grNPl4WJy71t4af LHMVoBG/nW4qZW0F+dgpdM9mUpQbXgIR0ZNBu9jicylmqSgpQoYOR4CdIMIJy99GCSGD KjFBnS8yo2rqRGFPt6uX+tgg0cjIl8VGBGdmLT8Kx3iqT8kMU3U93G2Ck5UzK1zHBFzn lUKw==
- In-reply-to: <CAHYJk3QJO8XGhJoKVFWugV6pnMDzPs8C=NmYPWQheBUooexv0w__28304.959919636$1562776081$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: Mikael Magnusson <mikachu@xxxxxxxxx>, Pier Paolo Grassi <pierpaolog@xxxxxxxxx>, Zsh-Users List <zsh-users@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20190710133731.GA13596@cventin.lip.ens-lyon.fr> <CAP+y1xBPc_jLNLrGiXvYXSzjwWdvMj_gTDkP=d6wwG+rA9NhuA@mail.gmail.com> <CAHYJk3QJO8XGhJoKVFWugV6pnMDzPs8C=NmYPWQheBUooexv0w__28304.959919636$1562776081$gmane$org@mail.gmail.com>
2019-07-10 18:26:42 +0200, Mikael Magnusson:
> On 7/10/19, Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
> > you can do something like this:
> >
> > setopt NULL_GLOB
> > typeset -a arr=(*(^@))
> > ls ${^arr}/file
> >
> > but I'm curious if there is any solution that doesn't require using an
> > intermediate array
>
> There isn't.
[...]
Well, there is
ls -d -- (*/)##file~*/*/*
(a corrected version of the one I suggested in my related
zsh-workers thread at
https://www.zsh.org/mla/workers/2019/msg00501.html).
But I wouldn't call it "a solution".
That works because (*/)## doesn't follow symlinks, but obviously
that means crawling the whole directory tree while we only care
for depth 1.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author