LinuxQuestions.org
Review your favorite Linux distribution.
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 02-22-2005, 02:35 PM   #1
mcedpd
LQ Newbie
 
Registered: Feb 2005
Posts: 13

Rep: Reputation: 0
Question Running a .sh file


Hello, I'm trying to install epijs and the final step is to run a file with the extension .sh. How do I go about doing this?
Do I use the command prompt window? Can I just double click on it?
Also, does anybody know how to convert c source code, that's supposed to be used with a castle compiler, so it can be compiled with gcc?

I look forward to hearing from you soon, Cheers, Dom.
 
Old 02-22-2005, 02:48 PM   #2
noobtesting
Member
 
Registered: Mar 2004
Location: Illinois
Distribution: Mint 15
Posts: 163

Rep: Reputation: 30
I think in console you will need to type:

./filename.sh

then press enter not sure if you have to be root but it never hurts to be safe.
 
Old 02-22-2005, 02:53 PM   #3
koodoo
Member
 
Registered: Aug 2004
Location: a small village faraway in the mountains
Distribution: Fedora Core 1, Slackware 10.0 | 2.4.26 | custom 2.6.14.2, Slackware 10.2 | 11.0, Slackware64-13
Posts: 345

Rep: Reputation: 33
Hi,

You can run the .sh file from the command prompt window.

Just open a terminal window and cd to the directory that contains

the .sh file. Then type :

[root@localhost root] ./<filename.sh>

(without the '< >' signs)

This should work. If it dosen't then probably the file is not executable

and u will have to make it executable. Type :

[root@localhost root] chmod +x <filename.sh>

[root@localhost root] ./<filename.sh>

This should work.

Refer to the chmod man pages for more help

ciao.
 
Old 02-22-2005, 04:07 PM   #4
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
if you just type the path to a file it will try to execute it e.g.

/opt/kde/bin/k3b will start the K3b cd tool on my box

as well as ./filename you can also use the syntax

sh filename

as noted above the file has to have the relevant permissions....

so sayeth a unix admin...........
 
Old 02-22-2005, 04:24 PM   #5
sh1ft
Member
 
Registered: Feb 2004
Location: Ottawa, Ontario, Can
Distribution: Slackware, ubuntu
Posts: 391

Rep: Reputation: 32
Quote:
Originally posted by noobtesting
I think in console you will need to type:

./filename.sh

then press enter not sure if you have to be root but it never hurts to be safe.
That's fine if it's executable, as koodoo said if it's not it won't run then you must chmod it (quite a few extra steps).

I run all my .sh files by doing:
Code:
$ sh ./whatever.sh
This ensures it will run whether it is executable or not.
 
Old 02-22-2005, 06:58 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The .sh extension might also mean that the script file doesn't use any bash extensions. Starting the program as 'sh <filename>.sh will run bash in a mode compatible sh.

Mostly, a downloaded file or a file in cdrom may not have executable bit set, or will have a different owner. using 'sh <filename>.sh' will save you the trouble. The extension itself means nothing to the system, but is just a convention and visual clue.
 
Old 02-23-2005, 04:00 AM   #7
mcedpd
LQ Newbie
 
Registered: Feb 2005
Posts: 13

Original Poster
Rep: Reputation: 0
Nice one, cheers people, what should happen in the command window after that? When I've installed other things there's normally a huge amount of text scrolls up the screen as it installs, but with this there wasn't, is this normal?
 
Old 02-26-2005, 06:34 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You said it was the final step. Perhaps you've already done most of the work. If the script installs pre-compiled binaries, it may simply need to copy files to target directories. I don't know that this particular installation does. If it is a script, you could read it to find out what is does.
 
  


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
Running file under https labratmatt Linux - Software 1 01-07-2005 03:39 AM
Running a file on boot Carpaurion Red Hat 2 12-01-2004 12:26 PM
about running c++ object file glee4ever Programming 2 03-02-2004 10:26 PM
Running a file from ram Bd22 Linux - Software 3 02-01-2004 01:05 AM
Running a script file johnlb Linux - Newbie 2 02-19-2003 02:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:51 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