Sorting by date in a bash script... mm/dd/yyyy

Given a list of dates like so...

10/13/2003
7/3/2004
1/6/2005
4/22/2004
11/2/2003

...how can I sort them youngest to oldest?

This is for a bash script under cygwin on winxp.
LVL 15
veedarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
awk -F/ '{printf("%04d%02d%02d %s\n",$3,$1,$2,$0)}' list | sort -r | awk '{print $2}'

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
veedarAuthor Commented:
I had to provide the full path /usr/bin/sort as it was picking up the windows sort. Once I did that it worked like a charm.
Thanks you ozo
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.