How can this be done in awk?
The output of the list of resolv.conf is like this:
hostA:domain abc.com
hostA:search abc.com xyz mno
hostA:nameserver 1.1.1.1
hostA:nameserver 2.2.2.2
hostB:domain abc.com
hostB:nameserver 1.1.1.1
hostB:nameserver 2.2.2.2
hostB:nameserver 3.3.3.3
hostB:nameserver 4.4.4.4
hostC:domain def.com
hostC:nameserver 7.7.7.7
hostC:nameserver 8.8.8.8
hostC:nameserver 1.9.2.1
hostC:search def.com x24.com
The output would be:
hostA hostB hostC
domain abc.com abc.com def.com
nameserver 1.1.1.1 1.1.1.1 7.7.7.7
nameserver 2.2.2.2 2.2.2.2 8.8.8.8
nameserver 3.3.3.3
nameserver 4.4.4.4 1.9.2.1
search abc.com def.com
search xyz x24.com
search mno
Thanks!!
The output of the list of resolv.conf is like this:
hostA:domain abc.com
hostA:search abc.com xyz mno
hostA:nameserver 1.1.1.1
hostA:nameserver 2.2.2.2
hostB:domain abc.com
hostB:nameserver 1.1.1.1
hostB:nameserver 2.2.2.2
hostB:nameserver 3.3.3.3
hostB:nameserver 4.4.4.4
hostC:domain def.com
hostC:nameserver 7.7.7.7
hostC:nameserver 8.8.8.8
hostC:nameserver 1.9.2.1
hostC:search def.com x24.com
The output would be:
hostA hostB hostC
domain abc.com abc.com def.com
nameserver 1.1.1.1 1.1.1.1 7.7.7.7
nameserver 2.2.2.2 2.2.2.2 8.8.8.8
nameserver 3.3.3.3
nameserver 4.4.4.4 1.9.2.1
search abc.com def.com
search xyz x24.com
search mno
Thanks!!