i have a script that check for the last date entry made in a series of files
--------------------------------------------------------------------
a=`date +"%Y-%m-%d"`
for i in *.log*
do
cat $i | grep $a
echo $i >> file1.txt
echo $a >> file1.txt
done
-----------------------------------------------------------------------
but this format of date i,e "a" checks for current/today date .
i want the date that checks the last date put into that files.the format should be same as y-m-d
-----------------------------------------------------------------------