LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-25-2006, 11:49 PM   #1
sathish80
Member
 
Registered: Jan 2006
Posts: 44

Rep: Reputation: 15
How to compile a shell script


Hi,

I want to know how to run and compile a shell script
 
Old 03-26-2006, 12:26 AM   #2
Mad Scientist
Member
 
Registered: May 2003
Posts: 167

Rep: Reputation: 30
No compilation necessary. Usually you can just do a

Code:
sh scriptname
or if the script is executable, you can do

Code:
./scriptname
 
Old 03-26-2006, 09:55 AM   #3
chandan
Member
 
Registered: Feb 2003
Location: Bangalore, India
Distribution: Fedora Core 2
Posts: 60

Rep: Reputation: 15
To extend the above answer...
To make your shell script executable use the following command
chmod +x <filename>
Usually the first line of the shell script will decide which program is used as the interpreter of the commands of the shell script
If the first line of your shell script is
#!/bin/bash
Then bash will be used for running the commands of your shell 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
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 03:14 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 03:34 PM
shell script to compile manojg Linux - Newbie 10 12-17-2005 11:22 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
shell script to compile java czy11421 Programming 4 04-30-2004 10:42 AM


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