On 26/09/2019 13:13, Robert Elz wrote:
So, if we have
[[:alpha]
there is absolutely no question but that this is a bracket expr
that matches one of the 7 chars
[ : a l p h a
and is in no way any kind of character class reference, whatever it
looks like its author may have intended, and regardless of what comes
after it.
If the standard says any different, or implies different, or even allows
different, it is simply wrong.
If this is the whole pattern, then agreed, but if this is only part of
the pattern, I am not sure. [[:alpha]:]] is interpreted by many shells
(bash, bosh, mksh, zsh) as a character class containing an invalid
character class name "alpha]". It may also be treated as such in ksh and
yash, but as the whole pattern fails to match anything, it is hard to
tell how exactly they interpret it. The interpretation as "any of the
characters in '[:alpha', followed by ':]]', is something I only see in
osh and in your shell.
Cheers,
Harald van Dijk