4

I just install Ubuntu. One of the things I miss about windows is the lack of executable.

When I right click the .sh file, go to permissions, and check "Allow executing as a program", it never does execute as a program when I double click it.

Another solution I found is doing it in the terminal. This doesn't work either. enter image description here

What am I doing wrong? Is this really too stupid of a question or am I too stupid? Thanks for any help!

P.-H. Lin
  • 2,844
  • 1
  • 19
  • 20
Cole Lodge
  • 41
  • 1
  • 1
  • 2

6 Answers6

9

After you run chmod +x your shell script became executable. Now you can run it

./ts3client_runscript.sh

from the directory script lives in. Its a bit tricky, don't forget to put ./ in front of shell script file name.

at0S
  • 191
  • 3
2

After giving it the permission to run then go to edit menu and click on preferences, then click on behavior tab, after that you will see an entry named "Executable text files" there check the 'Ask each time' radio button. Now you can run it by double clicking and by selecting 'run'.

1

For executing script in Linux first of all you have to give full permission.

commands for full permission:

 sudo chmod 777 ts3client_runscript.sh

       or

 sudo chmod a+x ts3client_runscript.sh

then you can run your script by this command

 ./ts3client_runscript.sh
1

What you have done by running the command chmod +x nameofshell.sh is, you made the shell to be executable as a program. Now it is executable, so that you can execute it. You cant make the execution process by simply double clicking it. To do this,Open terminal by alt+ctrl+T, go to the directory containing the shell using the command cd /path/to/location/ and then type

./nameofshell.sh

Hit enter! Done!

Anandu M Das
  • 2,303
0

open the file to check if the sha bang (first line) is #!/bin/bash. after this, try to execute the file by using shell like this: sh your_file.sh

hermest
  • 54
-1

How about this command:

sudo sh ts3client_runscript.sh