Zembower, Kevin wrote:
> I'm trying to write a perl one-liner to return the unique IP addresses
> from a Apache web log, like this:
> 
> perl -ne 'print if s/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) .*/$1/'
> access.log | nawk '!x[$0]++'

perl -lne'/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) / && !$x{$1}++ && print $1'


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to