To produce output to stdout
Code:
for FILE in /var/named/*db ; do ./extract $FILE ; done
To get it into a file 'all-records.txt':
Code:
for FILE in /var/named/*db ; do ./extract $FILE ; done >all-records.txt
You can filter out the ftp and localhost entries by using grep
Code:
./extract zone-example | egrep -v '(^localhost|^ftp)'
accounttest.com. IN A 35.45.68.21
Cannot you just regenerate those virtual hosts sections like I did in the first script?