On Monday 25 May 2009 02:01:10 Chuck Payne wrote:
Guys,
A question. I been trying to figure out how to get the out put I want. I got a log that I am do a grep on statement mykeyword, but I to get it and the line that follows. I been doing a search now for how to do this on google, but no luck. Is there a way of doing this, or do I need to use grep.
If I parse your question correctly, what you're looking for is grep -A 1 mykeyword logfile An awk hack (I'm not very fluent in awk-ish): { while ($0 ~ /foo/) { print; i=getline; } if (i > 0){ print; print "---------"; i=0; } } Just use grep Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org