LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2005, 03:12 PM   #1
boeroe
LQ Newbie
 
Registered: Feb 2005
Location: suriname
Distribution: suse
Posts: 3

Rep: Reputation: 0
make c-program that accepts shell commands and execute them


i am a student living in suriname ans a complete newbie to linux and c.
i have to write a c-program that accepts shell commands with parameters and executes them. the program has to use the spaces in the command to execute the commands. who can put me on the right track?
 
Old 02-17-2005, 04:30 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Interesting man pages for your program:
man fgets
man system
 
Old 02-17-2005, 09:48 PM   #3
boeroe
LQ Newbie
 
Registered: Feb 2005
Location: suriname
Distribution: suse
Posts: 3

Original Poster
Rep: Reputation: 0
thx i have read the manuel Will try to write something.
fgets let you read the command string and with system you can execute a shell command from within a c program. Have to read further about the forks..
 
Old 02-18-2005, 05:15 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Reading this thread http://www.linuxquestions.org/questi...hreadid=288546
may help with fork().
 
Old 02-18-2005, 08:41 AM   #5
boeroe
LQ Newbie
 
Registered: Feb 2005
Location: suriname
Distribution: suse
Posts: 3

Original Poster
Rep: Reputation: 0
thx had a quick look .Saw some usefull code..
 
  


Reply



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
how can i make commands execute when I turn on linux? versaulis Linux - Software 1 08-29-2004 06:51 PM
'make' & 'make install commands not recognised by shell gilbertt Linux - Software 4 05-04-2004 08:04 AM
Is it possible to make a Linux server execute a program on a WinXP system? Cichlasoma Linux - General 4 04-23-2004 06:00 AM
Shell commands in GNU make MadCactus Programming 2 02-19-2004 04:36 AM
Shell commands in GNU make? MadCactus Linux - Software 0 02-17-2004 03:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:10 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
Open Source Consulting | Domain Registration