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 22.214.171.124 www.google.com. 300 IN A 126.96.36.199
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.)