File existence and increment

 
count=0;
while read line;
 do [[ -e "$line" ]] && let  count=count+1; done < file_name.txt
 echo
 echo "$count of 10  files found "
 echo

The scenario is a follows :
I have a file which contains a list of filenames present in particular directory .
I am checking fo the existence of the file and incrementing the counter by 1.
Now there are some files which are of a previous date ( but as the file name is same , it passes my check )
So what i plan to do is

store

 
ls -lrt file_name | awk {'print$7'} 

in a varibale
store

 
date +'%d' 

in a variable and compare both , if they dont match thn don't increment the counter .

Please advise.

What you want to do exactly .........? you want to count the Files which are accessed today ?

Yes absolutely right ... ( but the list of filenames to be considered is written in a file )

You can touch .filename (it's name same as file name in the file_list) when you find the date change ,so
if you find filename older than .filename ,so ,it has changed.

if [ file1 -ot file2 ]

we can just think .filename is a timestamp file...

hi .. got ur point but how do i implement that ... any suggestions

1,"touch" file .file
2,when somebody modify file . so .file is older than file.
3,if [ .file -ot file ];then
touch .file #the modify time changed
echo "file has modified"
else
echo "file not changed"
fi