9

I wrote a shell script which opens some directories and runs some script, I run this bash file by terminal (bash filename.sh), how can I make it clickable?

4
  • 1
    Did you try this? Commented Feb 9, 2017 at 8:59
  • create a desktop entry, and specify the running command of this desktop entry to your script full path. see here Commented Feb 9, 2017 at 9:06
  • Did you put a #! line in your script? It should be "clickable" (not a good term) if you can run it from the command-line as just filename.sh. Commented Feb 9, 2017 at 9:07
  • What does this script look like? Which desktop environment are you running? Unity? Mate? Gnome? Commented Feb 9, 2017 at 9:28

2 Answers 2

18

You need to add the following shebang line to the top of your code.

#!/bin/bash

You also need to ensure that the script has executable permissions by running:

chmod a+x <filename>.sh

Sign up to request clarification or add additional context in comments.

Comments

3

You first need to start your script with

'#!/bin/bash '

and save it as <filename>.sh Also make sure that you keep the permissions as a+x i.e all users can execute the script.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.