Skip to content

Instantly share code, notes, and snippets.

@dannofx
Created March 16, 2017 04:11
Show Gist options
  • Save dannofx/386aafc673cca176b6358d0c5a028e1a to your computer and use it in GitHub Desktop.
Save dannofx/386aafc673cca176b6358d0c5a028e1a to your computer and use it in GitHub Desktop.
macOS: Watches the content of the clipboard every 0.5 seconds and print it out to the general output.
#!/bin/bash
LAST_TEXT=
while :
do
CURRENT_TEXT=`pbpaste`
if [ "$LAST_TEXT" != "$CURRENT_TEXT" ]
then
echo $CURRENT_TEXT
echo ""
LAST_TEXT=$CURRENT_TEXT
fi
sleep 0.5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment