用法:st.pl > log
###--------st.pl----------------------------------------- ##############
#!/usr/bin/perl -w
use POSIX qw(strftime);
open LOG,"/var/log/maillog";
my %hash;
while(<LOG>) {
if ($_ =~ m/to=<(.*?)>/) {
$hash{$1}++;
}
}
my $i=0;
foreach (sort keys %hash) {
print "$_/n";
$i++;
}
print "---All Count:",$i."---/n";
close LOG;
###--------st.pl----------------------------------------- ##############
#!/usr/bin/perl -w
use POSIX qw(strftime);
open LOG,"/var/log/maillog";
my %hash;
while(<LOG>) {
if ($_ =~ m/to=<(.*?)>/) {
$hash{$1}++;
}
}
my $i=0;
foreach (sort keys %hash) {
print "$_/n";
$i++;
}
print "---All Count:",$i."---/n";
close LOG;