It's sorting by alphanumerics - ignore the : and the -, and look at the remaining characters; as far as sort is concerned, the top two lines are identical.
On Mon, Oct 05, 2009 at 09:12:21AM -0700, O. O. wrote: > > Hi, > I am attempting to use the sort command on Linux (2.6), and it does > not seem to work the way I had expected. I tried various options in > the man page, but I could not get it to work. Any ideas??? > I first attempted to sort the following file: (Delimiters are tabs) > > ------------- try_sort.txt --------------- > a x b c > a y b c > a x d e > ---------------------------------------------- > > u...@servername:~$ sort try_sort.txt > a x b c > a x d e > a y b c > > This seems OK to me. It seems to get the x’s together and the y’s > together, which is what I expected. I now changed x’s to be 0-1 and > the y’s to be 0:1 > > ------------- try_sort1.txt --------------- > a 0-1 b c > a 0:1 b c > a 0-1 d e > ---------------------------------------------- > > u...@servername:~$ sort try_sort1.txt > a 0-1 b c > a 0:1 b c > a 0-1 d e > > Why is this different from the first case. I only expected x and y by > the above mentioned values, and it does not seem to sort. > > I would be grateful if someone could help me sort this. > > Thanks a lot, > O.O. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
