Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Watch command for long-term monitoring
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
You can’t perform that action at this time.