In a script I want to be able to write an IP address to somewhere easily, so I thought using dig (or a similar command) with back-ticks.
However the simplest output I've been able to come up to wrt dig parameters is
> dig -t A +noall +answer www.google.com www.google.com. 300 IN A 220.127.116.11 www.google.com. 300 IN A 18.104.22.168
Any way (extra arg, different tool instead of dig?) to get rid of the junk apart from the IP address?? (And please don't tell me to use sed.)