On Thu, 2022-01-27 at 15:18 +0000, Harald van Dijk via austin-group-l
at The Open Group wrote:
> The benefit of this that when the
> shell's locale changes, variables still hold their original text (as
> opposed to their original bytes).
But doesn't that by itself already violate POSIX?
There is "2.5.3 Shell Variables", which AFAIU says that setting
LANG/LC_* must take effect during the shell runtime.
LC_CTYPE says:
"Determine the interpretation of sequences of bytes of text data as
characters (for example, single-byte as opposed to multi-byte
characters), which characters are defined as letters (character class
alpha) and <blank> characters (character class blank), and the behavior
of character classes within pattern matching. Changing the value of
LC_CTYPE after the shell has started shall not affect the lexical
processing of shell commands in the current shell execution environment
or its subshells. Invoking a shell script or performing exec sh
subjects the new shell to the changes in LC_CTYPE."
=> lexical scanning of the current script stays
=> everything else, changes
including e.g. printf, or things like ${#var}, ${var##}, etc.
Right?
So if the shell would keep holding it's original text/characters.. this
wouldn't work (or the shell would need to convert every time)?
Cheers,
Chris.