I need to write a simple script that reads a continuous live log file, and if I find a particular string, write the next line to another log file. I've tried vaiour tail -f | grep combinations. This should be simple, but I can't get it so work. Any ideas?
by the way, may I ask if there are situations where you really need both -f and redirection?
If you want to see it in real time, leave away redirection.
If you need it afterwards, do a grep afterwards, leave away tail.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.