Originally posted by suthercd:
Robert,
This performs as advertised on my machine:
Code:
#!/bin/sh
# pingreturnvalue.sh
HOST=some.address.here.com
if ping -c 1 $HOST &> /dev/null ; then
echo "Successful ping to $HOST"
else
echo "Ping failed to $HOST"
fi
HTH
Craig
I've tried that.....it successes on machine where you can send a packet but isn't returnable.
That is the error I'm finding with ping.
So lets say I ping tony.tony.tony no DNS machine off I get ping failed.
I ping ***.***.*** where the macine exists but is behind a firewall I get a success.
I ping 192.168.X.X on my local network I get a success.
It is the middle condition which should be a failure.
OS X 10.3.4.