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

Re: confusing passage in zshexpn(1)



Peter Stephenson <pws@xxxxxxx>:
> Frank Terbeck wrote:
[...]
> > That's because of the trailing parentheses in the globbing pattern.
> > But the manual suggests that this should work.
> 
> Well, as Bart pointed out, no it doesn't, it's indicating precedence of
> interpretation and nowhere says it's in the form you need to match a
> file under every possible circumstance.

Yes, that's how I understood it as well in the first place. I thought
the way the person on IRC understood it was reasonable as well. But
it's true that people shouldn't see every sentence as potential
real-life examples.

> But it's easy to add a cautionary note.

Okay. But I hope that won't lead people to demand warning notes for
every little piece of documentation that (treated alone) looks like an
example.

[...]
> > [snip]
> > % file=12222
> > % [[ ${file} == 1(2##) ]] && print match.
> > match.
> 
> Do you mean you're suggesting this as an alternative example that would
> actually work?

No! :-) I just didn't know how to express what I wanted to say
properly.

> [...] it's cleaner to write this as 12## anyway, without the
> parentheses.  That's why you don't fall over the glob qualifier
> problem in practice:  you only need the parentheses when there are
> #'s after them.

Yes, that was my reply on IRC as well. I was just confused and didn't
think close enough before posting.

> By the way, if you feel yourself susceptible to problems like this,
> you can set both NO_BARE_GLOB_QUAL and EXTENDED_GLOB and use (#q...) for
> glob qualifiers.

No, I don't. But thank you anyway. :)

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



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