watch: Add --equexit option
This commit adds a new option called --equexit
which is the opposite
of --chgexit
. This option makes it possible to exit when the output
of the given command does not change for the given number of cycles.
A download operation could be given as a use-case since watch
will
exit when the output does not change anymore, in other words, when
the download is completed.
Examples:
$ watch -q 2 echo 'exit after 2 cycles'
# exit on subsequent messages
$ watch -n 1 -q 2 "if (( RANDOM % 2 )); then echo 'flip'; else echo 'flop'; fi"
References: #232 (closed)
Edited by orhun