#!/bin/sh gethostbyname() { ping -c 1 $1|sed -ne '1s/[^(]*(\([^ )]*\)).*/\1/p'; } gethostbyname "$@"