LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-16-2011, 01:13 PM   #1
DaveLister
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Rep: Reputation: 0
script help


So if I have a .c script should it run on its own or am I supposed to use gcc to compile it first?
 
Old 03-16-2011, 01:18 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
The extension doesn't mean anything. You can name a file anything you want, and linux will look at the header. But generally, the convention is to name files needing a C compiler *.c. Anything that needs compiling is generally referred to as a "program", not a script.

Scripting uses an interpreter to read the commands in the file to do something. Most linux distros use Bash as their commandline. So you can generate a bash script that will be a series of commands that you can run in bash by typing /path/to/scriptname.sh. These files start with a special line to tell you what language. See here for more info.
 
Old 03-16-2011, 01:30 PM   #3
DaveLister
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks!

Seems I was missing a semi-colon, now gcc compiles it nicely
 
Old 03-16-2011, 08:08 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,256

Rep: Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686
Glad you got there Don't forget to mark as SOLVED once you have a solution.
 
  


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
[SOLVED] Script question: create a shell script in kde to log in on a server with ssh c4719929 Linux - Newbie 1 01-31-2011 04:05 AM
Bash script problem with ftp session exiting the script early edomingox Programming 5 02-23-2010 06:39 AM
How to get full path to script file inside script itself? And in case of sym links? maggus Linux - Newbie 3 05-28-2009 09:40 AM
Shell Script: want to insert values in database when update script runs ring Programming 2 10-25-2007 11:48 PM
i get an error message running php script inside a cgi script. repolona Linux - Software 0 02-22-2007 10:10 PM


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