Shortcut to copy string to clipboard via command line in osx
Simply add this to your .bashrc or .zshrc or whatever you prefer:
alias strtoclipboard="osascript -e 'set the clipboard to \"STRING TO CLIPBOARD\"'"
Then open a new shell and execute your new alias strtoclipboard. CMD+V should show STRING TO CLIPBOARD. Adjust it to your needs.
It's pretty neat lets say for passwords which can't be saved.
Written by Oliver Petznick
Related protips
1 Response
nice, thx!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#