Suppose we have a parent process and if it calls an exec function, after calling a fork to create child process.
Now what happens to the child process: will it act like the original parent process, such that the user won't spot the difference that the parent process got replaced with some other binary ?
I think this question differs from the following question what happens to child process?.
if ( (pid == fork ()) != 0 )
{
if (strcmp(cmd,"mypwd")==0)
{
execlp (“mypwd”,0);
}
...
...
else if (strcmp(cmd,"myexit")==0)
exit(1);
}