Try
Code:
text=`xclip -selection clipboard -o`
Those are back quotes instead of straight quotes.
Actually it's better to use
Code:
text=$(xclip -selection clipboard -o)
for reasons explained
here, including the one you know about -- that back quotes are easily mistaken for straight quotes!