#!/usr/bin/perl if( $ARGV[0] ){ $filename=$ARGV[0]; }else{ print "USAGE: getUserAgent <logfile name>\n"; exit; } open FILE,"</path/$filename" or die "Can't open /path/$filename becaus +e $!"; $over=0; while( <FILE> ){ if( m/\b(Mozilla\b.*)/ ){ print "$1\n"; $over++ if( (length $1) > 100 ); } } print "$over over 100\n";
In reply to Re: grabbing info from log after key word
by I0
in thread grabbing info from log after key word
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |