Here's a potential problem with the script: ping performs two DNS resolutions during its operation: resolves yahoo.com to an IP, then resolves...
Separate names with a comma.