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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-22-2005, 02:35 PM
|
#1
|
LQ Newbie
Registered: Feb 2005
Posts: 13
Rep:
|
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.
|
|
|
02-22-2005, 02:48 PM
|
#2
|
Member
Registered: Mar 2004
Location: Illinois
Distribution: Mint 15
Posts: 163
Rep:
|
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.
|
|
|
02-22-2005, 02:53 PM
|
#3
|
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:
|
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.
|
|
|
02-22-2005, 04:07 PM
|
#4
|
Senior Member
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491
Rep:
|
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...........
|
|
|
02-22-2005, 04:24 PM
|
#5
|
Member
Registered: Feb 2004
Location: Ottawa, Ontario, Can
Distribution: Slackware, ubuntu
Posts: 391
Rep:
|
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: This ensures it will run whether it is executable or not.
|
|
|
02-22-2005, 06:58 PM
|
#6
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
02-23-2005, 04:00 AM
|
#7
|
LQ Newbie
Registered: Feb 2005
Posts: 13
Original Poster
Rep:
|
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?
|
|
|
02-26-2005, 06:34 AM
|
#8
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
All times are GMT -5. The time now is 06:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|