Date:        Fri, 14 Jun 2019 20:27:25 +0100
    From:        Stephane Chazelas <stephane.chaze...@gmail.com>
    Message-ID:  <20190614192725.fp7oefzvcucuh...@chaz.gmail.com>

  | And again, there is no such thing as a "pattern quoting char" in
  | most sh implementations including ksh88 (and all its
  | predecessors,

You're right, there wasn't, but (perhaps by oversight, perhaps
deliberately) it was added to the standard sometime in the past
(I presume when all the glob style matching specification was
merged into one piece of text).

What's more, it is a good thing, as it makes sh pattern matching
more regular, with less surprises.

  | Bourne, Mashey, Thomson),

Ken's name has a 'p' in it.

  | Again the portable way for a pattern stored in a variable to
  | match on something that starts with \ is:
  |
  |     pattern='[\\]*'

Today, that's probably true for script writers, but there's no
good excuse for shells not to DTRT here, even if scripts cannot
currently count upon it.

  | Insisting that it should be
  |     pattern='\\*'

I insist on no such thing, the [] forms work as well, and can be
used as an alternate - and for me, since it is more traditional,
better way - though I don't like the double \\ in there - if \
is not to be an escape char, it should not need escaping, should it?

kre

Reply via email to