Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • It worked perfectly, but locale is different under cygwin and linux. In cygwin is c.utf8, whereas in linux is C.UTF-8 and I cannot find how to use same script that works in the same way in any bash shell (modern). Thanks. Commented Feb 4, 2016 at 17:18
  • 1
    Possibly helpful: Check if a specific locale is enabled in bash Commented Feb 16, 2018 at 12:57
  • Note: export LC_ALL=... does not change LANG and LANGUAGE (test with locale command) Commented Nov 29, 2020 at 19:53
  • 1
    In my Fedora 32 it's C.utf8, so giving those variations among linux flavors, the best is to just prefix the C locale before an specific arithmetic command, like this: result=$(LC_ALL=C your_arithmetic_command) Commented Jan 3, 2021 at 23:47
  • Yes @Nelson, good idea. Since the C locale should be using the ASCII subset of UTF-8, that should just work. Commented Jan 4, 2021 at 14:40