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

Re: Is this a bug?



On Tue, Apr 19, 2022 at 10:13 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> Hmm?
> % mkdir -p {a,Volumes}/{b,Volumes}/{c,Volumes}
> % print -l ((^Volumes)/)#
> a/
> a/b/
> a/b/c/

Sure, but try ((^Volumes)/)#/ and suddenly you're recursing from the root.

For Perry's specific use case, ./((^Volumes)/)#/ is OK, because he
only cares about directories, bad things can happen if you end that
with another glob.  I discounted ./((^Volumes)/)#/(^Volumes) but
that's because it runs afoul of bare_glob_qual, it works if you unset
that or append some other qualifier to force (^...) to be taken as a
pattern.




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