LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2006, 12:37 PM   #1
Black Hawk
Member
 
Registered: Mar 2006
Distribution: Ubuntu 7.10
Posts: 38

Rep: Reputation: 15
How do I run a shell script? (Debian)


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

Thanks in advance
 
Old 11-30-2006, 12:40 PM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
./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
 
Old 11-30-2006, 02:10 PM   #3
revof11
Member
 
Registered: Nov 2003
Location: Macungie, PA
Distribution: Fedora Core 9, Gentoo 2008.0
Posts: 108

Rep: Reputation: 15
could just use "sh <yourscript>" too.
 
Old 11-30-2006, 02:23 PM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run a shell script in the perl script sharad Linux - General 1 05-24-2006 04:23 AM
How to run SHELL script pito Linux - Newbie 4 12-17-2004 04:05 AM
Shell script to run pl/sql script. colly Linux - General 1 09-09-2004 07:49 AM
how do i run shell script? krt47 Linux - Newbie 4 08-02-2004 10:29 AM
how to run a shell script oasisbhrnw99 Linux - Newbie 1 05-05-2004 02:21 PM


All times are GMT -5. The time now is 10:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration