View Single Post
Posts: 76 | Thanked: 5 times | Joined on Jul 2006
#2
The extension doesn't matter (although .sh is sometimes used).

What is missing is the correct permission on the file, you need to do something like this:
chmod ugo+x somescript

meaning set eXecutable attribute for the file's User,Group and Other (i.e. everyone) users. The other attributes are r=Read and w=Write, which can all be set independently for the User, Group and 'Other'.

Additionally, the filesystem that holds the file needs to be executable - the memory card is not, so that command would not help for files stored there.

One other pitfall if you're used to DOS, the current directory is NOT part of the path searched for executables (for security reasons). So you need to specify a path to run the script even if it's in the current directory.

It can be a relative path, so this will do:

./somescript