Hi
I have a requirement to write a script to capture all errors in a
Logfile and send the file in email.
If there is any error occurred the subject of email will be ERROR , If there are no error occurred the subject of email will be SUCCESS.
So I created a Log file and put the Appropriate message to
Logfile.
I check $? !=0 then I write "**ERROR** happened in this task" to Log file.
At the end of the script I do
Quote:
Error_Count=`grep **ERROR** Logfile | wc -l`
But I get
Null in $Error_Count. So I am not able determine how to know if there are any ERROR.
But when I open the Logfile after the script finishes I see **ERROR** present in Logfile. Can anyone suggest me how to capture all error message and send in Logfile.
Thanks and Regards
Digambar