As an FYI this is on Linux.
I want to have one of the options in a script to be to pull the selected text. So I start my script
#!/bin/bash
xclip -o > ~/bin/temp.txt
However, if I don't have anything selected this throws the error
./test
Error: target STRING not available
Can I check whether something is selected and skip this command if there isn't?