From: Zach Riggle <zachriggle@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Compound Glob Specifiers
Date: Mon, 8 Nov 2021 17:03:36 -0600 [thread overview]
Message-ID: <CAMP9c5kG4cR7QxMu93cLeZn_4BmZht=toAijxj4GvnKbYMm5Gw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
I expect this is a case of "you're holding it wrong", but I figure it's
worth asking what the right way to do this is...
I want to glob the equivalent of */*/somefile (not **/foo, specifically two
directories deep).
However, I do NOT want the glob to match if any of the directory components
are a symlink.
*(/) is the glob specifier for directories [1]
It would then follow that *(/)/*(/)/somefile would match dir/dir/somefile
and not dir/link/somefile.
This is not the case -- even *(/)/ (i.e. appending a trailing slash to all
directories) do not work out-of-the-box as one might expect.
I've read through 14.8 Filename Generation [2] as best I can (my favorite
hack being the NTREF=reffile bit) but haven't found anything that suggests
how one might do this.
[1]
https://zsh.sourceforge.io/Doc/Release/Expansion.html#index-BARE_005fGLOB_005fQUAL_002c-use-of
[2]
https://zsh.sourceforge.io/Doc/Release/Expansion.html#Filename-Generation
*Zach Riggle*
[-- Attachment #2: Type: text/html, Size: 1576 bytes --]
next reply other threads:[~2021-11-08 23:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 23:03 Zach Riggle [this message]
2021-11-09 3:04 ` Lawrence Velázquez
2021-11-09 3:30 ` Bart Schaefer
2021-11-09 7:52 ` Mikael Magnusson
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='CAMP9c5kG4cR7QxMu93cLeZn_4BmZht=toAijxj4GvnKbYMm5Gw@mail.gmail.com' \
--to=zachriggle@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).