On Mon, 2022-02-21 at 09:58 +0000, Geoff Clare via austin-group-l at
The Open Group wrote:
> The reason the LC_ALL=C is needed to avoid unspecified behaviour is
> because the description of the ${parameter%[word]} expansion refers
> to 2.13 for how the pattern matching is done, and 2.13 is worded
> entirely in terms of characters.

Well not exactly, as far as I can see:

2.13 itself (i.e. without sub-chapters) doesn't even contain the word
character and instead says:

"The pattern matching notation described in this section is used to
specify patterns for matching STRINGS in the shell."


3.375 String defines:
"A contiguous sequence of bytes terminated by and including the first
null byte."


Only 2.13.1 and .2 talks all about characters.


Not sure whether I miss anything obvious, but that's what I meant in my
previous mail:
- Is the "string" in 2.13 simply wrong?
- If not, could one imply from the (byte) "string" in 2.13 upon which
  the characters from 2.13.1/.2 are matched, that these need to ignore
  any non-character bytes.
  => Which, I assume, is what Thomas had in mind?
- Or perhaps simply that it mustn't be applied on any (byte) strings
  that contain non-character?


The standard even compares with fnmatch(), which would also operate on
C-strings.


Cheers,
Chrs.

  • Re: how do t... Christoph Anton Mitterer via austin-group-l at The Open Group
    • Re: how... Geoff Clare via austin-group-l at The Open Group
      • Re:... Christoph Anton Mitterer via austin-group-l at The Open Group

Reply via email to