LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I run a shell script? (Debian) (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-run-a-shell-script-debian-506260/)

Black Hawk 11-30-2006 11:37 AM

How do I run a shell script? (Debian)
 
How do I run a shell script on a Debian box?

Thanks in advance

nx5000 11-30-2006 11:40 AM

./shell-script will open a new shell and run shell-script, shell-script has to be executable (chmod +x shell-script)
. shell-script will run it in the current shell

revof11 11-30-2006 01:10 PM

could just use "sh <yourscript>" too.

b0uncer 11-30-2006 01:23 PM

Quote:

could just use "sh <yourscript>" too.
...to run it using sh, but if there is some reason to run it in a different shell (usually scripts, in the first line, tell which shell should run them, though), you could use respectively
Code:

bash yourscript
(or ksh, csh, tcsh or some other shell instead of bash).

Most people just use
Code:

/path/to/the/script
or if it's in the current dir,
Code:

./script


All times are GMT -5. The time now is 07:46 AM.