Thanks Mike for your helping hand ......actually I have to extract the ORA- error datewise.....the log_file contents many errors with old dates and it's updated everyday ....... I have to run the script every day so that it extracts the ORA- errors for the current date......
Depends on the size of your log file - if it's medium size then I'd just run the above and then grep the output for the current date. If it's a very very large file then you could tail the last 10000 lines and then run as above, greping for the current date again.
That's true......but it is difficult to grep both ORA- and current date combilely.If I put tail -1000f then it shows many old dated errors.As I am having 17 different log_files and have to extract the errors (ORA-) from each file. Trying to extract the error datewise means when I will run the script it will show the ORA- for current day. I have to make a daily Error Report for all 17 the log_files.
Can we put a current date as input to this script so that it will find only today's ORA- errors .