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
- X-seq: zsh-users 10657
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: I want to list the NEXT line after a string appears in a list of files
- Date: Sat, 2 Sep 2006 13:59:38 +0000 (UTC)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: SuccessTheory
- References: <Xns9831A29573C98zzappergmailcom@xxxxxxxxxxx> <20060901151507.GA32421@xxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
John Eikenberry <jae@xxxxxxxx> wrote in news:20060901151507.GA32421
@mollari.zhar.net:
> 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
That's useful I thought I knew everything about grep but no!
BTW works without the tail
egrep -iA2 "^Anecdote" m??.txt
--
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips
Messages sorted by:
Reverse Date,
Date,
Thread,
Author