LinuxQuestions.org
Help answer threads with 0 replies.
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 11-20-2007, 02:12 AM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Rep: Reputation: 30
Running Other Programs within a Program


What function call do I need to make to run a program within another program? Say I wanted to run a shell script from a C++ program.
 
Old 11-20-2007, 02:27 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
system()? If this doesn't do what you want, you'll need to explain further.
 
Old 11-20-2007, 06:11 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
The key qn is do you need to recv output from the called prog or just run it & continue?
 
Old 11-20-2007, 08:29 PM   #4
array lin
LQ Newbie
 
Registered: Nov 2007
Location: SuZhou, China
Posts: 12

Rep: Reputation: 0
system(char *cmdname) if you just only run a new programe.
 
Old 11-20-2007, 11:18 PM   #5
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
Thanks for the help. That was exactly what I was looking for.
 
  


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
Running program from terminal with & does nothing, program stops DittoAlex Linux - General 1 10-05-2007 01:35 AM
Running programs from a C++ program... audibel Programming 1 03-08-2005 07:33 PM
Running Programs Slayer097 Linux - Newbie 3 02-23-2005 04:43 PM
HElP Running Programs pbrian17 Linux - Newbie 2 10-09-2004 03:03 AM
Help on Running Programs mooreted Linux - Software 3 05-16-2003 10:32 PM

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

All times are GMT -5. The time now is 04:44 PM.

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