Script question for BIND
by dupa from LinuxQuestions.org on (#5SE0V)
I need to or want to delete BIND DNS entries that match A records from another file. If the DNS entry has multiple records associated to it in File2, those need to remove too.
File1
Code:grep -vwf file1 file2Code:grep -f <(cat file1 | sed 's/^/^/' ) file2
File1
- car.example.com 192.168.10.1
- truck.example.com 192.168.10.2
- bike.example.com 192.168.10.5
- car.example.com 192.168.10.1, 192.168.10.10, 192.168.10.20
- truck.example.com 192.168.10.2
- bike.example.com 192.168.10.5, trek.example.com
- car.example.com 172.10.1.12
- truck.example.com 172.10.1.15
- bike.example.com 172.10.2.20
Code:grep -vwf file1 file2Code:grep -f <(cat file1 | sed 's/^/^/' ) file2