i want to make a child process run in background using fork and execvp, i saw many same questions but for some reason none of them really ment run in background. when i mean i want the program to run in background i mean i dont want to see it at all. currently i have a program called e_print whuch prints output every 1 second, i want to keep it running but not see the output (really run in background) here my code:
if((son = fork())==0){//son process
i = execvp(tokens_set[0],tokens_set);//tokens set was previously set
if(i == (-1)){
perror("couldn't find the command: ");
}
exit(0);
}else{ // father process
printf("father proccess goes on\n");
}
for some reason all the guides and questions i saw called it run in background but the childs output was seen.
i want to keep the father running, say ask for another input from user and meanwhile i want the e_print process to run. same as:
./e_print &
from terminal.