hi i need the shell script to get the file with latest date.
for example in my input folder i have files like
file_20130212.txt
file_20130211.txt
now my output folder should have the file with latest date i.e..file_20120212.txt
i want to get the latest file .. i.e is should take the value 20130212 from the file and should convert it to 2013-02-12 and should check with the system date and should return the latest file based on the date format..
I am confused with the new requirement.
Do you want to get the latest file based on last modified/create date/time or the one which is present in the filename.