search a logfile for strings
Hi experts..
I am trying to write a shell script which will scan a log file for three strings ie success image1, success image2, success image3.
My shell is tcsh
If all the 3 strings are found then insert the 3 strings to a file1 and send mail to developers with file1
If all 3 are note found copy the strings to a file2 and send file2 to developers.
Similarly, if string image1 & image2 are found and image3 missing...then insert the string image1 & image2 to file-1 and insert the string image3 to file-2 and send a mail attaching both file1 & file2 to developer.
I tried with "if - else" but that is making the scrip longer,
Could anyone please tell me different way (ideally,using fgrep\grep\sed\awk..or other)
Thanks'
Amit
Amit...
__________________
Amit...
|