LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   make c-program that accepts shell commands and execute them (http://www.linuxquestions.org/questions/programming-9/make-c-program-that-accepts-shell-commands-and-execute-them-291508/)

boeroe 02-17-2005 04:12 PM

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?

Hko 02-17-2005 05:30 PM

Interesting man pages for your program:
man fgets
man system

boeroe 02-17-2005 10:48 PM

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..

Hko 02-18-2005 06:15 AM

Reading this thread http://www.linuxquestions.org/questi...hreadid=288546
may help with fork().

boeroe 02-18-2005 09:41 AM

thx had a quick look .Saw some usefull code..


All times are GMT -5. The time now is 08:30 AM.