|Hello. I need a bat file to check a file for a keyword and return the count as a number. |
I have a file called /logs/Load20101230.log on a Unix platform. Within this log file, I need to know how many times the word 'error' is contained in the file. But I am running into an issue. Every day this file is archived and a new file created with the current date. So I need the batch file to only check the current days log file, and not the previous days log file. Another issue I have is this. There is also a failover server that we use from time to time. I need to check this server for a log file of the current date. If there is no log file of the current date, I need the script to retrun a 0.
Any help would be appreciated.