LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-20-2003, 09:23 PM   #1
justinv
LQ Newbie
 
Registered: Jan 2003
Location: New Zealand
Distribution: Mandrake, SuSE
Posts: 13

Rep: Reputation: 0
Executing shell scripts


If you have a shell script file (as in a .sh), how do you run it? You can double click on it and then choose run in terminal, but often the terminal closes before you've seen what's happened. What would be the prompt command?
Would this be the same for Redhat?
 
Old 01-20-2003, 11:15 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Open up a terminal and then run the command in question. It shouldn't close after running that way.
 
Old 01-20-2003, 11:17 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Gidday justin...

Usually you'd want to open a shell and run the
script from there if you are interested in its output...

Cheers,
Tink
 
Old 01-21-2003, 01:51 AM   #4
justinv
LQ Newbie
 
Registered: Jan 2003
Location: New Zealand
Distribution: Mandrake, SuSE
Posts: 13

Original Poster
Rep: Reputation: 0
Thankyou guys.
 
Old 01-21-2003, 02:02 AM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 77
cd to the directory that has the script and type "./scriptname" and press enter.
Else,
type the full path of the script and press enter ie: /home/user/scripts/scriptname

Oh yeah, make sure it's executable ie: "chmod 777 scriptname" or chmod 744 or 755 or 700 or whatever...

Last edited by bulliver; 01-21-2003 at 02:03 AM.
 
Old 01-25-2003, 02:22 PM   #6
elite_syntax
LQ Newbie
 
Registered: Jan 2003
Posts: 3

Rep: Reputation: 0
 
Old 01-26-2003, 08:57 AM   #7
justinv
LQ Newbie
 
Registered: Jan 2003
Location: New Zealand
Distribution: Mandrake, SuSE
Posts: 13

Original Poster
Rep: Reputation: 0
what does that mean mate? what's confusing?
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
stop konqueror executing shell scripts ahh Linux - Software 2 03-27-2005 07:00 AM
CGI Scripts not executing, pls help john_d13 Linux - General 3 12-22-2004 03:05 PM
Prevent konqueror from executing shell scripts Dave Farrance Mandriva 1 05-30-2004 09:37 PM
Executing scripts upon login jungatheart Linux - Newbie 3 04-19-2004 07:06 PM
Executing Shell Scripts? l0f33t Linux - General 7 08-17-2003 04:36 PM


All times are GMT -5. The time now is 10:02 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration