Hi Everyone,
I am writing a shell script and I am struck here:
I need to find the latest file in a directory depending upon the date.
For example:
The files in the directory are:
Filename_bo_20110619
Filename_bo_20110620
Filename_bo_20110621
Filename_bo_20110622
So here, I want to pick up the lastest file ( Filename_bo_20110622) in the directory.
but Todays Date: 20110624. and the file doen't exists in the dir for todays date so I need to pick up the latest file that exists in the dir.
Could someone please help me out in this. I want to integrate the logic in the shell script.
Any ideas would be really appreciated.