I need to write a program that is to be run as follows: <program_name>_ <space> _<file_name>_ <space> _<stuff to be written into the file>
. I am new to Linux/C/Unix programming and so I need your help. From what I can understand, I need to write a program titled <program_name>
, pass two parameters in the main function which are <file_name>
and <stuff to be written in the file>
, and then go through the code as usual, writing all the required lines. Am I going about this the right way? Also, it is mentioned that I am to create a make file out of the program. As I am thoroughly unfamiliar with Linux, I would like to know if that this would change anything. That is, would my approach to the program change because I am to make a make file out of it? Thanks for the help! :)
Asked
Active
Viewed 187 times
-4

CodingInCircles
- 2,565
- 11
- 59
- 84
-
3You need to go read some tutorials. This site can't teach you all of this from scratch. – bmargulies Sep 24 '11 at 21:47
-
@bmarguies: What should I even look for? If you can give me a heads up, I'll look into it. Unfortunately, there was no way I could type this into Google and get an answer. Do you know what I should look up at least? – CodingInCircles Sep 24 '11 at 21:51
-
1I googled 'linux c hello-world tutorial'. for a start, http://www.thegeekstuff.com/2010/08/make-utility/. Then 'linux c arguments' and found http://stackoverflow.com/questions/498320/pass-arguments-into-c-program-from-command-line. – bmargulies Sep 24 '11 at 21:53
-
@bmarguies: THANK YOU! If you can put this down as an answer, I can then mark it as one and close the question. Thanks a lot! :) – CodingInCircles Sep 24 '11 at 21:58
-
1Honestly, I'm not sure that this makes sense as a permanent question/answer on this site, so I'll just leave things as they are. Thanks for the offer. – bmargulies Sep 24 '11 at 22:00
-
@bmargulies: Maybe not, but at least I'm on the right track now - thanks to you :) If you can, can you also answer my other question on ACLs? It's here: [Question on ACL](http://stackoverflow.com/questions/7541979/how-to-check-if-a-uid-exists-in-an-acl-in-linux). Thanks in advance! :) – CodingInCircles Sep 24 '11 at 22:07
1 Answers
1
You should search for "beginning linux" to get some web sites that will give you the basics of navigating around in Linux, notably on the command line.
Then I'd search for "beginning vi" to learn the basics of the vi editor. If you're using a GUI, then you can simply use their simple GUI text editor.
Then I would search on "Beginning C programming linux". That will give you several links, and will get you through the basics of creating a C program and compiling it with GCC.
That should keep you in enough trouble for the short term until something clicks or you learn enough new terms to keep searching for.
Good luck!

Will Hartung
- 115,893
- 19
- 128
- 203
-
Thanks! That's what I'm doing now, after @bmargulies guided me. – CodingInCircles Sep 24 '11 at 22:08