4

I am unable to run .sh file in Ubuntu 14.04. The same file was executing in earlier version 12.xx. After upgrading to 14.04, this file stopped running. How to resolve this issue?

2 Answers2

7

All that you need to do is set default action here File Manager > Edit > Preferences > Behaviour forExecutable Text Files. In Ubuntu 14.04 it is set to View Executable Files when they are opened

eldos
  • 186
3

You can check whether or not the script is executable by doing something like:

$ ls -l nameoffile

replacing nameoffile with the name of the script. The output will look like:

-rwxr-xr-x  1 users users 848101 Mar 12 11:22 configure

The last x in the first column, means that this file is an executable. If this x is missing, it means that the file is not executable. You can easily fix this. To make a script executable, you can execute:

chmod +x /path/to/nameofscript.sh

After that to execute it from the command line, you can do:

./path/to/nameofscript

Xubu-tur referenced a very good explanation for doing this from a graphical environment.

jobin
  • 28,567
BakaKuna
  • 188