Unix sort treatment of underscore character

后端 未结 5 995
半阙折子戏
半阙折子戏 2020-12-30 01:16

I have two linux machines, on which unix sort seems to behave differently. I believe I\'ve narrowed it down to the treatment of the underscore character.

If I run

5条回答
  •  轮回少年
    2020-12-30 01:34

    The difference is due to your locale. Use the locale command to check the current settings.

    There are a number of different locale categories, such as LC_COLLATE, LC_TIME, and LC_MESSAGES. You can change them all by setting the environment variable LC_ALL or LANG, or only the collation (sort) order by setting the environment variable LC_COLLATE. The locale C or POSIX is a basic locale defined by the standard; others include en_US (US English), fr_FR (French), etc.

提交回复
热议问题