LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
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: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
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


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


All times are GMT -5. The time now is 02:46 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration