On Fri, 2022-01-07 at 18:01 -0500, Lawrence Velázquez wrote:
> It's not invalid, though. An unquoted [ can match literally.
>https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13_01:
Yeah, I was confused by the patterns '[' referring to "XBD RE Bracket
Expression" (which would not allow the empty unquoted open bracket),
while for the patterns it is allowed.
On Fri, 2022-01-07 at 18:44 -0500, Lawrence Velázquez wrote:
> As I noted in the message I just sent, POSIX doesn't actually say
> that case patterns undergo quote removal; rather, it addresses
> quoting in its description of pattern matching. This kinda sorta
> covers the observed behavior, but it could certainly be clearer.
I was especially confused by the [ of the patterns referring to the
BRE's in which the characters would be taken literally (and there would
be two stages of unquoting).
>
> More or less. Without an unquoted ], there is no bracket expression,
> so:
>
> Â Â Â - The unquoted [ characters match literally.
> Â Â Â - The unquoted * retains its special meaning and matches zero
> Â Â Â Â Â or more arbitrary characters.
With [ alone being taken literally in patterns, it's clear!
Thanks again for your help :-)
Chris.