Hi,
I have many files in the source directory but I need to process with the latest timestamp file.
I am using linux operating system. i want extract the file created timestamp( Ext_File_create_date=)
With this format YYYYMMDD-
i have searched the relevent command in the unix forms but did not find relevent information.
Example:
Jun 23 10:10 new_file22062012101010.txt
Jun 24 11:15 new_file23062012111010.txt
Jun 25 09:10 new_file24062012111590.txt #latest file
################################################--
# Get the today date with YYYYMMDD format.
################################################--
Today_date=`date +Y%m%d`
################################################--
# Extract file created date with format YYYYMMDD
################################################--
Ext_File_create_date= #get the file created timestamp YYYYMMDD
################################################--
# Date comparision
################################################--
if [ "$Today_date" = "$Ext_File_create_date ]
then
echo "today file arrived"
elce
echo 'today file not arrrived"
fi
Thanks
Suri