From owner-freebsd-questions@FreeBSD.ORG Fri Jun 20 07:21:55 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0837E37B401 for ; Fri, 20 Jun 2003 07:21:55 -0700 (PDT) Received: from wonkity.com (wonkity.com [65.173.111.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4361543F85 for ; Fri, 20 Jun 2003 07:21:54 -0700 (PDT) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.12.9/8.12.9) with ESMTP id h5KELrXk012833; Fri, 20 Jun 2003 08:21:53 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.12.9/8.12.9/Submit) with ESMTP id h5KELrnw012830; Fri, 20 Jun 2003 08:21:53 -0600 (MDT) Date: Fri, 20 Jun 2003 08:21:52 -0600 (MDT) From: Warren Block To: Matthew Seaman In-Reply-To: <20030620134326.GA615@happy-idiot-talk.infracaninophile.co.uk> Message-ID: <20030620081951.G12793@wonkity.com> References: <20030620130049.63710.qmail@web10002.mail.yahoo.com> <20030620134326.GA615@happy-idiot-talk.infracaninophile.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Ronnie Clark cc: FreeBSD Questions Subject: Re: IPFW Log question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2003 14:21:55 -0000 On Fri, 20 Jun 2003, Matthew Seaman wrote: > > Or if anyone has a perl script that tosses out the odd > > lines and just keeps the full lines and is willing to > > share it, that would work too. Otherwise, I am going > > to have to get better at perl in a big way. > > #!/usr/bin/perl -w > > $prevline = ""; > > while (<>) { > if (m/last message repeated (\d+) times/) { > for ( 1 .. $1 ) { > print $prevline; > } > } else { > print $_; > $prevline = $_; > } > } If I read that right, this would also work: #!/usr/bin/perl -w while (<>) { print $_ unless $_ =~ /last message repeated (\d+) times/; } -Warren Block * Rapid City, South Dakota USA