I want to start a shell oder sqlplus in the child witch execute the commandos from parent
i dont want to start a new child for each commando or use exec(ls, ... ) each time
is there a way to solve this ?
Code:
if (new_process==0) {
close(fd[1]);
while(1)
{
if(sizeof(readbuffer)>0)
nbytes = read(fd[0], readbuffer, sizeof(readbuffer));
printf("Read string: %s \n ", readbuffer);
//!!! my problem i dont want to print "ls" all the time i want a shell witch exec ls
// and all other command the child will get by parent
// my solution is to cread a new child making system("command");
// but i want to run a shell or sqlplus or something else in this process to execute the
// parents output
}
}
if (new_process>0) {
// yeah i know its a loop but its the simpelst thing to test without readline stuff
char * buf ="ls"
close(fd[0]);
while (1)
{
write(fd[1], buf, (strlen(buf)+1));
}
}
}