Within a ksh script, I would like to first determine whether or not
a remote
host is alive before I attempt other network access to it, (file reads
or writes).
The ping command seems to be the logical solution, but if I have to wait
for
the ping command to fail due to network time-out to indicate that the
remote
host is not available I've gained nothing over just letting my other
network
access commands time-out.
Is there a way to execute ping wrapped in a timer - such as in a
subprocess
that gets killed by it's parent if it doesn't end within a practical
time interval?
It seems to me that that should work, but what I'm really looking for is
someone who would share code that has already been written.
Much appreciated.