Jay Hannah is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

Tee-hee! Thanks to Walt for his annual reminder how awesome one-liners are!


My use today (squash HUGE IP list into CIDR blocks):

perl -MNet::CIDR::Lite -ne 'BEGIN{$cidr = Net::CIDR::Lite->new} s/[\r\n]+$//; $cidr->add_ip($_); END{print join "\r\n", $cidr->list; print "\r\n"}' IPs.txt

Jay Hannah @deafferret

Cleaner if Unix (or using -l):

perl -MNet::CIDR::Lite -lnE 'BEGIN{$cidr = Net::CIDR::Lite->new} $cidr->add_ip($_); END{say join "\n", $cidr->list}' IP.txt | head

· Web · 0 · 0