Just guess what this "one-liner" does :-)
ls -1 10.39.* | xargs perl -e '@files = map { $_->[0] } sort { $a->[1] <=> $b->[1]} map { [$_,(split /\./,$_)[2]] } @ARGV ; while ($file = shift @files) { print STDERR "\n\n>>>>> $file\n\n" ;my $net = (split /\./,$file)[2] ; open F,$file ; while (<F>) { if (/^\s*;/) { print ; next } ; chomp ; my @RRdata = split/\s+/,$_,4 ; next unless $RRdata[2] eq 'PTR' ; $RRdata[0].=".$net" ; print join("\t",@RRdata),"\n" ; } ; close F }' > 10.39Ciao!
--bronto
The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: merge zones
by cLive ;-) (Prior) on Apr 02, 2004 at 08:00 UTC | |
by bronto (Priest) on Apr 02, 2004 at 13:47 UTC |