LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   running a .sh script (https://www.linuxquestions.org/questions/linux-software-2/running-a-sh-script-489017/)

bungle3 10-03-2006 08:33 AM

running a .sh script
 
Am trying to run a .sh script file. Have been away from linux for a few months, been trying to remember how to run one. Have tried the old ./ but doesn't work, i know its similar but can't remember. Anyone help me out?

MOS JEFF-INITELY 10-03-2006 08:55 AM

check permissions set to executable.
check that your $PATH has '.'

konsolebox 10-03-2006 08:56 AM

try

# sh scriptfile.sh
# bash scriptfile.sh

marozsas 10-03-2006 08:59 AM

You can run bash using the script as an argument,
Code:

$ bash /path/to/your/script.sh
or you can turn it into a executable and run it as a command

Code:

$ cd /path/to/your
$ chmod u+x script.sh
$ ./script.sh

or add the path to it into PATH variable to run it from anywhere

Code:

$ export PATH=${PATH}:/path/to/your
$ chmod u+x /path/to/your/script.sh
$ script.sh



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