Ls is not the only program to sort things oddly. I prefer to see sorting
by strictly ASCII order, but I think some <censored> human-factors
weenies have stuck their miserable paws in and created a huge number of
ridiculous sort orders ... and every program uses a different one of
them!!!!
The one that bothers me the most is the "sort by name" for Nautilus.
Names starting with alphabetic characters are not too bad, but Lord help
anyone trying to find anything if the name starts with numerics. The
*&^% thing parses off the numeric substring terminated by a non-numeric,
then converts the numeric substring to a decimal number, and sorts on
THAT!!! Yikes! Thus we would have files ordered as "9abc.x", "73abc.x",
"501abc.x", "666abc.x", "1001abc.x", "9999abc.x", and so on. How to find
anything in that mess? I wonder if "LC_COLLATE=C" would have any effect
on Nautilus?
Jim Hartley
[email protected] wrote:
Perhaps you can `export LC_COLLATE=C'. This would give you the result
I think you're after. Sorry, even though I have all other LANG/LC_* as
en_US.UTF-8, LC_COLLATE is the one I have set to C. :-)
$ cat abc
a0b
a4b
a8b
a`b
a=b
a_b
$ LC_COLLATE=en_US.UTF-8 sort abc
a0b
a4b
a8b
a`b
a=b
a_b
$ LC_COLLATE=C sort abc
a0b
a4b
a8b
a=b
a_b
a`b
The LC_COLLATE=C case has perfectly ascending bytes.
-jesse
On Mon, Apr 6, 2009 at 10:44 PM, Adam <[email protected]> wrote:
[email protected] wrote:
To elucidate, try:
[a...@eris ls]$ /bin/ls | od -txz -w4
-jesse
Thanks, Jesse, but I'm still confused. Here's an excerpt from the output of
that command:
0000044 0a623961 >a9b.<
0000050 0a626161 >aab.<
0000054 0a624161 >aAb.<
0000060 0a626061 >a`b.<
0000064 0a625e61 >a^b.<
0000070 0a627e61 >a~b.<
0000074 0a623c61 >a<b.<
The third character of each line of the hex output seems to keep jumping up
and down: 39, 61 41 (okay, both of those are the same letter), 60, 5e, 7e,
3c. I don't understand why it's like that, instead of steadily increasing
(even if it were case-insensitive).
Adam
--
Teen Angel - a ghost story - http://teenangel.netfirms.com
_______________________________________________
Mid-Hudson Valley Linux Users Group http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
Upcoming Meetings (6pm - 8pm) MHVLS Auditorium
Mar 7 - Web Hack-a-thon - SUNY Newpaltz
Apr 1 - EC2 and Cloud Computer
May 6 - TBD