#!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; use File::Basename; my %already; my $i = 0; while (my $in = ) { chomp $in; my ($record, $domain, $token) = split /\t/, $in; print "$record -- $domain -- $token\n"; if (!$already{$domain}++) { `cp $domain $domain.old`; `<$domain.old grep -v $record >$domain`; } `echo $record IN TXT '\"$token\"' >>$domain`; last if ++$i == 4; } for my $domain (sort keys %already) { `v scp $domain ucm.dev:/etc/bind/freens/`; } `v sudo service bind9 reload & v ssh ucm.dev sudo service bind9 reload & wait`;