Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: I want to list the NEXT line after a string appears in a list of files



zzapper wrote:

> Hi
> I want to list the NEXT line after a string appears in a list of files
> 
> eg 
> > egrep "Anecdote" m??.txt (But display next line)
> 
> I guess Sed/Awk would do this, I would probably use Perl.
> 
> Suggestions pls
> 

Note zsh specific, but this should work.

egrep -A1 "Anecdote" m??.txt | tail -1

-- 

John Eikenberry
[jae@xxxxxxxx - http://zhar.net]
______________________________________________________________
"It is difficult to produce a television documentary that is both incisive
and probing when every twelve minutes one is interrupted by twelve dancing
rabbits singing about toilet paper." - Rod Serling



Messages sorted by: Reverse Date, Date, Thread, Author