Created
August 23, 2016 14:02
-
-
Save guysmoilov/cffc6d088b64a38592d0f08bd8f86159 to your computer and use it in GitHub Desktop.
Watch command for long-term monitoring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Watching $1 command" | |
PREV="" | |
while sleep 1; do | |
CURRENT=`eval $1` | |
if [ "$CURRENT" != "$PREV" ]; then | |
echo "[`date`]: $CURRENT" | |
PREV=$CURRENT | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment