LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How can I run .sh file in linux? (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-run-sh-file-in-linux-116908/)

Morning 11-17-2003 12:50 AM

How can I run .sh file in linux?
 
How can I run .sh file in linux?

Y0jiMb0 11-17-2003 01:26 AM

You have to make it executable ('chmod +x nameoffile.sh', which will make executable for every user) and then you have to type the name of the file with the path included (if the directory where it lives isn't in the PATH variable); for instance type
Code:

/home/joe/nameoffile.sh
or, if you are in the same directory just type
Code:

./nameoffile.sh
Regards

lyx0m 11-17-2003 10:21 AM

Don't forget to change permissions

chmod 700 myfile.sh or chomod 755 myfile.sh

lyx0m
:Pengy:

jim mcnamara 11-17-2003 10:37 AM

Assuming it's a Bourne shell script the first line of the shell shouldbe:

Code:

#! /usr/bin/sh

Edward78 11-17-2003 11:41 AM

./nameoffile.sh should do it, but go to where it is first.


All times are GMT -5. The time now is 07:54 PM.