0

I have created different scripts that I successfully used under Lubuntu/Lxde, including some made to be run by keyboard shortcut that would start firefox and search selected text on the internet.

For example, this script, if associated with a shortcut, should search selected text in google:

#! bin/sh
sh -c 'firefox "https://www.google.com/search?q='$'(xclip -o)"' 

One to translate French to English:

#! bin/sh
sh -c 'firefox "http://translate.google.com/#fr/en/$(xclip -o)"'

and so on

But in Mint/Xfce, cannot add these scripts to be run by shortcut in Settings/Keyboard/Application Shortcuts: I get an error similar to this:

enter image description here

I think some applications have to be installed to run this. But after installing xclip and git it still doesn't work.

6
  • 1
    You have a wrong shebang line, is that a typo? It should be #!/bin/sh. Also,please show the output of ls -l /home/cipricus/Documents/scripts/firefox/search-google.sh. Commented Feb 8, 2013 at 15:46
  • @terdon: the output:$ ls -l /home/cipricus/Documents/scripts/firefox/search-google.sh -rwxrwxr-x 1 cipricus cipricus 75 Nov 29 20:09 /home/cipricus/Documents/scripts/firefox/search-google.sh . the form of the script works fine, maybe something wrong with my copy/paste here? Commented Feb 8, 2013 at 15:49
  • And the shebang line? Commented Feb 8, 2013 at 15:50
  • don't know exactly what you say it's wrong. you say: "It should be #!/bin/sh". you mean no space between ! and /? i just open my otherwise working scripts and pasted here Commented Feb 8, 2013 at 15:54
  • 1
    More importantly, I mean it should have an /. In your question you have it as #! bin/bash instead of #!/bin/bash Commented Feb 8, 2013 at 15:54

1 Answer 1

0

As requested, I am posting my comment as an answer.

It looks like you have a bad shebang line. Try

#!/bin/bash

instead of

#! bin/bash

The space should not be an issue, the / before bash, however, is essential.

answered Feb 8, 2013 at 15:59

You must log in to answer this question.