@kbnetguy, this command should work on a Mac:
dig +short www.triggercmd.com | tail -n1I included the tail -n1 to use only the first line in case the host name returns multiple IP's.
You probably know this, but to assign the result to an environment variable you can do this:
export IP=$(dig +short www.triggercmd.com | tail -n1) echo $IPIf you must use ping, let me know. I had that command figured out for Linux, but Mac's ping and grep are different.