ipset-goodies/combine-counts.pl

17 lines
451 B
Perl
Raw Permalink Normal View History

2026-04-21 04:24:00 -05:00
#!/usr/bin/perl -nl
# print the name and total number of records in each unique ipset
#(c)2026 Corwin Brust <corwin@bru.st>
# You may use this program under the terms of the GNU Public License version three (3) or, at your option, any later version of that license. (GPLv3+)
#
# Input is expected on stdin as NAME COUNT and may contain duplicates NAMES
#
END {
print qq($_ $h{$_} )
for sort keys %h
}
$h{$1} += $2
if /^(\S+) (\d+)$/