Had something unexpected happen while using
sort the other day: it behaved differently on two different systems.
In a nutshell, I went to go sort data that looked like this:
The correct answer, due to case-sensitifivity, should have been:
This, by the way is what Cygwin happens to produce.
Instead I was getting the case-insensitve answer:
And while the sort program had a case-insenstivive switch,
-f, it always seemed to be applied.
I checked for a command
I tried a negation value,
-f-, and that did nothing for me.
Eventually I figured out that the issue was with the locale specified in the environment variables.
LC_ALL=en_US, then I got a case-insentive order, no matter what. The solution was to change it to
LC_ALL=C to get the case-sensitive version.
As GNU allows explicitly for case-insensitivity, I really wish they’d also explicitly allow for case-sensitivy.
This seems to trip up a lot of people, judging by the number of posts out there about it.