sorting on date

I have a file where dates in the form mm/dd/yyyy is the first field. How do I sort the file by the date field?

Thanks,

Duckman

read the man page for sort. Something like:
sort -t/ -k 3 <i>input_file</I>

should work.

but this will sort all dates with a common month together? before sorting on year?...ie,

01/15/1999
01/16/2000
02/01/1999

No. At least not in my version of sort. Check the man page if you need more details.

Thanks! it does indeed work, but I was just wondering how it also sorts the other month and day fields? i take this to mean, sort with "/" as the delimiter and only sort based on field 3(year)?

Thanks

From the man page:
<I>If all the specified keys compare equal, the entire record is used as the final key.</I>

So, we first sort based on field 3, lets say its 1999. To determine the order within the 1999 entries, they are sorted based on the entire record (numerical order). Which would mean (field seperator ignored):
01011999
01021999
01031999
01041999
...
etc

ohh!! it's as simple as that!! i'm going to kick myself : )
thanks again!