[CentOS] grep

Tue Aug 28 14:29:28 UTC 2007
Warren Young <warren at etr-usa.com>

Scott McClanahan wrote:
>
> I'd like to skip those lines.  I'd like to skip the line with "bar" and
> the following five lines.

In that case, the perl code would be:

#!/usr/bin/perl
$eat = 0;
while (<>) {
     if (m/bar/) {
	$eat = 6;
     }

     if ($eat) {
         --$eat;
     }
     else {
         print;
     }
}


Again, not tested.  Use at your own risk.