balaganesh
asked on
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...
Please give provide program or syntax for it...
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
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