PDA

View Full Version : Executing .sh files in SSH


bne123
2004-08-09, 16:25 PM
How do I execute a .sh file in SSH? Thanks.

Tino Didriksen
2004-08-09, 17:08 PM
cd to the folder where it is, then run
./filename.sh

If that gives you a permission error, do
chmod +x filename.sh
then
./filename.sh

bne123
2004-08-09, 17:20 PM
Whenever I try to run the .sh file, it returns the following error message:

run: unable to exec

I have checked the permissions and are -rwxrwxrwx

I am in the right directory, but I do not know what I am doing wrong. Can someone please help me? A big thank you in advanced!

htmlx
2004-08-09, 19:57 PM
make sure that the first line of the sh file contains:
#!/bin/sh

BlackNet
2004-08-10, 22:29 PM
Hello,

sh /path/to/file.sh should work, need not be +x.

Ed