[CentOS] grep
Warren Young
warren at etr-usa.comTue Aug 28 14:29:28 UTC 2007
- Previous message: [CentOS] grep
- Next message: [CentOS] grep
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: [CentOS] grep
- Next message: [CentOS] grep
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list