Page 1 of 1

RedHat's sort command is not sorting by character value.

Posted: Tue Apr 22, 2003 3:23 pm
by jasonb
The default sort order that RedHat uses changed in 7.x and later versions. The difference is shown as follows.

Old:

a b
a c
ab
ac

New:

a b
ab
a c
ac

In the new sorting order, the spaces are not treated like other alphanumeric characters, but are "secondary".

This is because the sort order was changed from "C" to "en_US". To get the old style of sorting back, simply set the environment variable "LC_ALL" to "C".