Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A question about filename generate




> On Jul 27, 2025, at 01:17, Marc Chantreux <mc@xxxxxxxxxx> wrote:
> 
> hello,
> 
> # when you can, please provide a way for people who want to help
> # a simple why to setup sandbox
> 
> mkdir subdir
> touch subdir/file{a..c}.{tex,aux}
> touch index.{tex,aux,log}
> 
> # prefered version because its result is streamed so you can
> # process things on fly:
> 
> find . \! -name '*.tex' -type f
> 
> # zsh glob version: retention of all the result to build the
> # print arguments list.
> 
> print -l **~*.tex(.)
> 
> regards

Sorry… I’m confused.

The find yields:
find . \! -name '*.tex' -type f
./subdir/filec.aux
./subdir/fileb.aux
./subdir/filea.aux
./index.log
./index.aux

The print yields:
print -l **~*.tex(.)
index.aux
index.log

What did I do wrong?

I think what you want is:

print -l **/*~*.tex(.)
index.aux
index.log
subdir/filea.aux
subdir/fileb.aux
subdir/filec.aux

But I’m still confused (surprised) why OPs original pattern did what it did.




Messages sorted by: Reverse Date, Date, Thread, Author