Hi all,

I know this is simple but I have having a brain lock today.

I have a file in which I need to find a particular line.  Once I find the line, 
I need to print the next 5 lines and quit.

The following gets me to the line but I am stuck from there.

#!/usr/bin/perl -w

open (INFILE,"filemon2005012970.out") || die("Cannot open file: $!");

@LINES = <INFILE>;

foreach (@LINES){
  chomp;
    if (/\/dev\/hdisk18  description:/){
     print "$_\n";
}
}

Thanks,

Craig


_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to