zsh-users
 help / color / mirror / code / Atom feed
* Compound Glob Specifiers
@ 2021-11-08 23:03 Zach Riggle
  2021-11-09  3:04 ` Lawrence Velázquez
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zach Riggle @ 2021-11-08 23:03 UTC (permalink / raw)
  To: Zsh Users

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-09  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 23:03 Compound Glob Specifiers Zach Riggle
2021-11-09  3:04 ` Lawrence Velázquez
2021-11-09  3:30 ` Bart Schaefer
2021-11-09  7:52 ` Mikael Magnusson

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).