Reputation: 3870
like in subject. I'm curious how to get value in bash script from Clipboard.
I would like to write sh script which after execution will take value from Clipboard (Ctrl+c), but I haven't found how to get this value in the script.
Any idea folks, thanks :)
Upvotes: 3
Views: 7095
Reputation: 4502
On Mac OS, pbcopy
/pbpaste
:
echo "Set the clipboard" | pbcopy
clipboard="$(pbpaste)"
On Linux with X11, xclip
.
echo "Set the clipboard" | xclip
clipboard="$(xclip -o)"
Upvotes: 9