When attempting to limit the ping command to a specific time period using the -w option I am faced with a similar problem as when using the -c option. The -w option will only stop the ping command after wait seconds if it recieves a response from the computer being pinged. Otherwise it will continue to ping that computer indefinately. Is there a fix to limit the ping command if it does not receive a response from a server such that it can be automated? The -w command should work regardless of whether the other computer responds or not.
Use both -c <npackets> and -w <nsecs>, this works for me using the ping in iputils-20000120-1 from Raw Hide.