I am trying to write a Bash script that when activated (via a xbindkeys shortcut) will assign selected text to a variable. Something like this:
read selectedtext echo "$selectedtext" | xclip
Obviously, the outcome will be an easy way to cut the current line to the system CLIPBOARD.
I realize my original question is kind of confusing. Here's an example:
$ This is a line of text
selectedtext="This is a line of text" echo "$selectedtext" | xclip