Most of the questions here are addressed by Chet's message and the
one I just sent, but...
On Fri, Jan 7, 2022, at 5:15 PM, Christoph Anton Mitterer wrote:
> But isn't this then a violation of POSIX? Or is there any part in it,
> which indicates that behaviour, i.e. that already quoted strings are
> already taken as literals with respect to the pattern?
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.
> And even stranger that (d)ash then matches [.xxxxxxxxxxxx^$[] ... how
> did you construct that?
>
> Or is there any logic behind it? Perhaps, that since it doesn't finde a
> closing ] (because that's taken literally, it also takes the first [
> literally?
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.
--
vq