From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11223 invoked from network); 1 Sep 2006 15:33:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Sep 2006 15:33:55 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 84944 invoked from network); 1 Sep 2006 15:33:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Sep 2006 15:33:47 -0000 Received: (qmail 3418 invoked by alias); 1 Sep 2006 15:33:41 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10653 Received: (qmail 3408 invoked from network); 1 Sep 2006 15:33:41 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 1 Sep 2006 15:33:41 -0000 Received: (qmail 83962 invoked from network); 1 Sep 2006 15:33:41 -0000 Received: from 24-241-49-70.static.athn.ga.charter.com (HELO gkar.zhar.net) (24.241.49.70) by a.mx.sunsite.dk with SMTP; 1 Sep 2006 15:33:39 -0000 Received: from mollari.zhar.net ([192.168.1.7]) by gkar.zhar.net with smtp (Exim 3.36 #1 (Debian)) id 1GJAnr-0005kc-00 for ; Fri, 01 Sep 2006 11:19:31 -0400 Received: by mollari.zhar.net (sSMTP sendmail emulation); Fri, 1 Sep 2006 11:15:07 -0400 Date: Fri, 1 Sep 2006 11:15:07 -0400 From: John Eikenberry To: zsh-users@sunsite.dk Subject: Re: I want to list the NEXT line after a string appears in a list of files Message-ID: <20060901151507.GA32421@mollari.zhar.net> Mail-Followup-To: John Eikenberry , zsh-users@sunsite.dk References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 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@zhar.net - 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