Hi there,
i have a problem with the ipc, i want to start a shell in the child process
like
Code:
//child
if (pid == 0){
system("sh");
}
//parent
else{
//readin from the command line (not the "sh" in child )
//send read to child an execute it in the "sh"
}
the readline stuff is not the problem, but i dont know how i could switch between child and parent because the shell is running all the time, i just can enter the parent if i exit the shell, is there a way to switch the process after finishing a shell command ?
like:
child start sh
switch process
parent readin "command"
parent send "command" to child
child execute "command"
child send the result of the command back to parent
parent printf ....