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
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to