Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I am trying to create a bash script for the Dash home button, as I am trying to fully replace the Unity dock with the Cairo Dock. Unfortunately, I have been unable to make it so that the script only runs when I click on it.

How can I make a bash script execute when clicked upon?

If it helps, here is my code:

#\bin\bash

xdotool key Super
share|improve this question
    
It's #!/bin/bash not #/bin/bash. We all make mistakes! –  It's Willem Jun 16 at 22:23

2 Answers 2

The shebang is wrong, type this instead :

#!/bin/bash

xdotool key Super

and set the execution bit on the script.

share|improve this answer
1  
set the eXecution bit by opening Terminal and typing sudo chmod +x <path/to/bash_file.bsh> –  SimplySimon Jun 15 '13 at 21:41

In Ubuntu 12.04, you should be able to do this simply by right-clicking the file, clicking properties in the drop-down menu, going to the permissions tab and checking the allow executing file as program button. If this does not work you can open a terminal and run this command:
sudo chmod +x /path/to/your/scriptfile. I hope I helped!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.