sort stdin and print

2004-03-18 Thread rmck
HI I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's. I would like to sort it and and eliminate duplicates count the sorted/unique ips then print??? I thought using the perl sort command would help but it did not... I

RE: sort stdin and print

2004-03-18 Thread Ned Cunningham
] Sent: Thursday, March 18, 2004 12:44 PM To: [EMAIL PROTECTED] Subject:sort stdin and print HI I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's

RE: sort stdin and print

2004-03-18 Thread Jayakumar Rajagopal
, 2004 12:44 PM To: [EMAIL PROTECTED] Subject: sort stdin and print HI I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's. I would like to sort it and and eliminate duplicates count the sorted/unique ips then print??? I

Re: sort stdin and print

2004-03-18 Thread Wiggins d Anconia
HI I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's. I would like to sort it and and eliminate duplicates count the sorted/unique ips then print??? Ok then do that ;-) I thought using the perl sort command

Re: sort stdin and print

2004-03-18 Thread John W. Krahn
Rmck wrote: HI Hello, I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's. I would like to sort it and and eliminate duplicates count the sorted/unique ips then print??? The best way to store unique values is to use a

Re: sort stdin and print

2004-03-18 Thread rmck
IP'S = 2 Not Ip=111.111.13473 Thanks, Rob -Original Message- From: John W. Krahn [EMAIL PROTECTED] Sent: Mar 18, 2004 10:39 AM To: [EMAIL PROTECTED] Subject: Re: sort stdin and print Rmck wrote: HI Hello, I have a script that reads stdin from the output of another script

Re: sort stdin and print

2004-03-18 Thread John W. Krahn
Rmck wrote: From: John W. Krahn [EMAIL PROTECTED] I would do it something like this: #!/usr/bin/perl use warnings; use strict; use Socket; my %IPs; while ( ) { $IPs{ inet_aton( $1 ) }++ if /\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b/; } for ( sort keys