LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 08: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, 10:15 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

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

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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, 12: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, 01: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: 78
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 01:03 AM.
 
Old 01-25-2003, 01:22 PM   #6
elite_syntax
LQ Newbie
 
Registered: Jan 2003
Posts: 3

Rep: Reputation: 0
 
Old 01-26-2003, 07: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



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 06:00 AM
CGI Scripts not executing, pls help john_d13 Linux - General 3 12-22-2004 02:05 PM
Prevent konqueror from executing shell scripts Dave Farrance Mandriva 1 05-30-2004 08:37 PM
Executing scripts upon login jungatheart Linux - Newbie 3 04-19-2004 06:06 PM
Executing Shell Scripts? l0f33t Linux - General 7 08-17-2003 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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
Open Source Consulting | Domain Registration