I have along list that created in /var/tmp/file.txt from some script (in Solaris machine) the following list have 4 fields
please advice how to sort the list according to the following TIMESTAMP ( by sort command or other solaris command )
for example the date & time 15-10-2009 08:29:18 should be before 15-10-2009 08:29:10 ... etc
example of file.txt ( not sorted file )
 PHONE_NUMBER TIMESTAMP ID TYPE -------------------- ------------------- ---- -------------- 972544111222 15-10-2009 08:29:18 20 sharp_gx10 33633333333 24-09-2009 16:17:45 20 other_mm_phone 841990000043 08-10-2009 09:04:38 60 other_mm_phone 972541230001 08-10-2009 14:23:48 20 other_mm_phone . . . .
I try the sort command but not clearly why file.txt not sorted
sort -t' ' -k2.7,2.10n -k2.4,2.5n -k2.1,2.2n -k3 /var/tmp/file.txt we get the output:
 5938123456789141 12-10-2009 13:09:22 20 other_phone 5511223322332233 07-03-2012 08:13:43 20 other_phone 888888 10-02-2012 14:13:58 60 LegacyPhone 111111 10-02-2012 14:13:59 60 LegacyPhone 777777 10-02-2012 14:13:59 60 LegacyPhone 999999 16-02-2012 14:07:32 10 other_phone 87654321 11-10-2009 09:39:37 10 other_phone 