I have to serch for an error like " Socket not open" in a log file named q2.log
and I have to send a mail if i find the string.
This process should happen at regular time intervel that i can schedule a chronjob,
But problem is for my first job lets assume I read 1 to 1000 lines For next time I have to search from 1000 to remaining .How can i achieve it
Thanks in advance
Asked
Active
Viewed 503 times
0

Be Positive
- 17
- 7
-
http://stackoverflow.com/questions/13109580/how-to-grep-a-string-after-a-specified-line-number – abasu Nov 08 '13 at 10:12
-
Hi abasu Thanks for reply,Is it possible to store the last searched line number in a buffer – Be Positive Nov 08 '13 at 10:34
-
`grep -n pattern file | cut -f1 -d':'` will give you the line number – abasu Nov 08 '13 at 11:38