On Fri, Jun 19, 2026 at 3:39 PM Chet Ramey via Bug reports for the GNU
Bourne Again SHell <[email protected]> wrote:
> I can't reproduce your results with bash-5.3, but I am not using Homebrew.

I can reproduce this if, in System Settings : Language & Region, I have:
* "Region" set to "Germany"
* "English" as the first entry in "Preferred Languages"
Note that the language has to be "English" (or "English (UK)"), and not
"English (US)".

    $ defaults read -g AppleLocale
    en_DE

    $ env -i ./bash -c \
        "printf '%f\n' 1; LC_NUMERIC=C printf '%f\n' 2; printf '%f\n' 3"
    1,000000
    2.000000
    ./bash: line 1: warning: setlocale: LC_NUMERIC: cannot change locale
    (): No such file or directory
    3.000000

Setting LANG or LC_ALL instead of LC_NUMERIC in the temp env works as
expected though:

    $ env -i ./bash -c \
        "printf '%f\n' 1; LC_ALL=C printf '%f\n' 2; printf '%f\n' 3"
    1,000000
    2.000000
    3,000000

As does setting LC_NUMERIC as a non-temp env variable:

    $ env -i ./bash -c \
        "printf '%f\n' 1; LC_NUMERIC=C; printf '%f\n' 2; printf '%f\n' 3"
    1,000000
    2.000000
    3.000000

I think the only unexpected behavior here is that undoing an LC category
change done in the temp env doesn't work correctly.

I see the same results with Bash from Homebrew and built from source.

Reply via email to