Hi,
Thanks for your reply.
I was copying and pasting the main code out of my file here(omitting the extra comments I have in my file). I had modified variable names in my main code but not in the comments.
Though, with all the variables correct, it is still not working.
-M command is working if it is between the opendir and closedir lines.
If -M is outside anywhere it is not working.
I am trying to compare the modification time of the latest modified file against the current time and make some decision if the time difference is more than 30 minutes.
Any suggestions?
Thanks.