Why doesn't **sort** sort the same on every machine?

后端 未结 4 1121
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 21:28

Using the same sort command with the same input produces different results on different machines. How do I fix that?

4条回答
  •  忘掉有多难
    2020-12-03 21:55

    This is probably due to different settings of the locale environment variables. sort will use these settings to determine how to compare strings. By setting these environment variables the way you want before calling sort, you should be able to force it to behave in one specific way.

提交回复
热议问题