Some times when I am trying out stuff on my terminal, I get some blockade or some error to resolve which I have to copy the error or last message then open my browser and then Google the query. Is it possible for me that I select the message via mouse and when I right click I get a Google it option as I get when I select some text on a browser?

PS : I am not asking how to do Google search via terminal or how to browse web via terminal.These were the results I got when I goggled my question. what I want is something more general. Whenever I select a piece of text I should get a "Google me" option with the right click of my mouse(or maybe with pressing of a key or something). I would prefer that the query takes place in a browser and not in a terminal.

To use this script, copy/paste it in a new text file (gedit ..), and name it whatever you like, eg google_clip.sh. Set execute permission, chmod +x /filepath/google_clip.sh or right-click in Nautilus then Properties -> Permissions -> check Execute. Then keybind it.