zsh-users
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Pier Paolo Grassi <pierpaolog@gmail.com>,
	Zsh-Users List <zsh-users@zsh.org>
Subject: Re: glob qualifier on intermediate directory / no symbolic links
Date: Sun, 21 Jul 2019 22:56:59 +0100	[thread overview]
Message-ID: <20190721215659.inqxmv6vuonutamp@chaz.gmail.com> (raw)
In-Reply-To: <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@gmail.com> 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

      parent reply	other threads:[~2019-07-21 21:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 13:37 Vincent Lefevre
2019-07-10 13:58 ` Pier Paolo Grassi
2019-07-10 16:26   ` Mikael Magnusson
2019-07-12  8:20   ` Vincent Lefevre
     [not found]   ` <20190712082023.GA3983__17556.0249060922$1562919714$gmane$org@zira.vinc17.org>
2019-07-21 21:40     ` Stephane Chazelas
     [not found]   ` <CAHYJk3QJO8XGhJoKVFWugV6pnMDzPs8C=NmYPWQheBUooexv0w__28304.959919636$1562776081$gmane$org@mail.gmail.com>
2019-07-21 21:56     ` Stephane Chazelas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190721215659.inqxmv6vuonutamp@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=mikachu@gmail.com \
    --cc=pierpaolog@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).