I would like to be able to interrupt watch if execution of command was successful. In effect, I'm looking for a reverse behaviour than that offered via
--errexit. As per man:
--errexitFreeze updates on command error, and exit after a key press.
ping -c 3 www.google.com
Fails due to the patchy connection*. I can re-run in the following manner to see when the connection is back:
watch -n 1 'ping -c 3 www.google.com'
I would like to stop watch if
ping executes with no error.
* I'm not looking to find a better of way of verifying connectivity. The
ping examples comes from using a mobile phone connection when on the train with mobile phone loosing signal every so often.