Within the past year I discovered dig's +short parameter, which let me retire some scripts I had for parsing just the IPs out of dig's output. e.g.:
dig +short google.com
dig +short google.com
[1]: http://www.commandlinefu.com/commands/view/2829/query-wikipe...