Skip to content
Advertisement

sed/awk to replace in a loop

I have a file called “demo” that has names in our DNS.

I’m trying to loop through each line and replace the “names” with “names and ip address” (as a way of verifying dns queries)

So far I have this but no luck on sed or awk command. Help appreciated.

Thanks.

demo

JavaScript

“diggs” has an alias that yields one line output.

desired output

JavaScript

process.sh

JavaScript

Advertisement

Answer

Your question is very unclear as to what you’re trying to do, but is this what you’re thinking? No need for getting sed or awk involved.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement