loop through the directory for files and sort by date and process the first file

hello

i have a requirement where i have a direcotry in which i get files in the format

STOCKS.20080114.dat
STOCKS.20080115.dat
STOCKS.20080117.dat
STOCKS.20080118.dat

i need to loop through the directory and sort by create date descending order and i need to process the first file.

can any body throw some light on it.

appreciate your help

nag

hi,
try this as a first step

#!/bin/ksh

for $f in `ls -lt`
do

done

Regards,
Alan Mehio
UK, London