is there a way to copy a string to clipboard from command line?
To be more specific, I want to make a script which copies my email address to clipboard, so that when I need to insert it several times for logging in / register, I just run the script once and then CMD+V it whenever I need.
I heard of pbcopy
, but I think this is not my case. Any suggestion?
Many thanks!
You need to pipe the output of your script to
pbcopy
For example:
echo 'your-email@example.com' | pbcopy (as @Jonathan Leffler stated above)
Or see the answer for the related question on piping to clipboard on different operating systems: Pipe to/from the clipboard