Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

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

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
balaganesh
Asked:
balaganesh
  • 3
1 Solution
 
sarda_rameshCommented:
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
 
sarda_rameshCommented:
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
 
sarda_rameshCommented:
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
 
AxterCommented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now