Skip to content

Instantly share code, notes, and snippets.

@timnew
Created September 18, 2017 05:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timnew/6532a7bfe2b2dc663d99d4dd178fc382 to your computer and use it in GitHub Desktop.
Save timnew/6532a7bfe2b2dc663d99d4dd178fc382 to your computer and use it in GitHub Desktop.
Automatically replace text in clipboard
while true; do pbpaste | sed -e "s/name:production-db/\$server-master/g" | sed -e "s/name:production-replicadb/\$server-replica/g" | pbcopy; sleep 1; done
@timnew
Copy link
Author

timnew commented Sep 18, 2017

Running the code in any shell, it monitors the clipboard, and do the replacement automatically.
So in the UI, the developer just need to copy and paste. The text will be updated automatically.
It is quite a magical way to replace specific text repeatedly in GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment