LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Creating a C program in redhat (https://www.linuxquestions.org/questions/linux-software-2/creating-a-c-program-in-redhat-4175449887/)

monojeffrey 02-12-2013 04:56 PM

Creating a C program in redhat
 
Hi

kindly guide on this two concepts

What is a scrpit?(linux)
what is a program? ( C program)

both do automation(repetitive tasks, calculations)

how to create a C program in redhat
is it possible to place the c program as start up script?

heard like kernel of unix is written in C language(Dennis ritchie)

does all the nis,nfs and all other software distributions are written in the same manner as a C program

Kustom42 02-12-2013 05:23 PM

Monojeffrey,


I appreciate that you are trying to learn how these things work but I think you should try to focus your learning a bit so you don't get overwhelmed and feel like you are all over the place.

The term "script" can be misconstrued easily, some people will use this term to refer to a compiled C program or to a basic for loop they wrote. It is kind of up your interpretation, it does not relate to a specific language or operating system. A .bat file on Windows could be considered a script.

C is a programming language, and yes most of the Linux kernel was wrote in C and the C programming language is a huge foundation for a lot of other programming languages and applications.

Now lets ask the first question.

Would you like to start by learning how to programming works and then learn how the Linux OS works?

or

Would you like to start by playing with the Linux operating system and learn programming later?


I would recommend you learn the basics of the OS, what BASH is and how to do the basics with it then you can start opening the programming can of worms.

Try www.linuxcommand.org/tlcl.php to start learning the OS. It will give you some BASH scripting exposure which will translate into C programming a lot easier.

chrism01 02-12-2013 08:02 PM

You should see this tutorial http://rute.2038bug.com/index.html.gz

bloodstreetboy 02-13-2013 01:40 AM

Write any C program in text editor and save as filename.c
To run this program, you have to compile it first.

Code:

$ gcc -o anyname /path/of/your/c_program_file/filename.c
This will generate a compile copy of your program.
Now create output copy of your program.Following command generate a output file of your program in same directory.
Code:

$ gcc /path/of/your/c_program_file/filename.c
Now run your program.
$ ./a.out
or
$./anyname

where a.out is output copy of your program. Alternatively you can run compile copy of your program.

monojeffrey 02-13-2013 01:46 PM

Kustom42

i would like to learn only how the linux OS works, since already has some exposure to programming

thanks for the kindly replies and advices


All times are GMT -5. The time now is 08:19 PM.