?
Solved

How to call a process into the background  in Unix on C++ program

Posted on 2003-03-04
4
Medium Priority
?
290 Views
Last Modified: 2010-04-01
How to call a process into the background  using system () function in C++ in Unix operating system?
Please give provide program or syntax  for it...
0
Comment
Question by:balaganesh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 1

Expert Comment

by:sarda_ramesh
ID: 8064677
hi
As we generally make a procee to run in background by adding an ampersand (&) to the command , the same way we can add an ampersand to the command as a parameter to system ..e.g

#include<stdio.h>

main()
{
   system("ls > output &");
}


this small code will run ls command in background and redirect the output to a file named output

0
 
LVL 1

Expert Comment

by:sarda_ramesh
ID: 8064696
hi
As we generally make a procee to run in background by adding an ampersand (&) to the command , the same way we can add an ampersand to the command as a parameter to system ..e.g

#include<stdio.h>

main()
{
   system("ls > output &");
}


this small code will run ls command in background and redirect the output to a file named output

0
 
LVL 1

Accepted Solution

by:
sarda_ramesh earned 200 total points
ID: 8064740
u can call the process as follows..

system("process naem &");

to make a process run in background add an ampersand(&) to the command ...

regards
ramesh

0
 
LVL 30

Expert Comment

by:Axter
ID: 9374696
balaganesh,
No comment has been added lately (196 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to sarda_ramesh http:#8064740

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

Axter
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question