Shell Interview Questions and Answers

 

What will happen to my current process when I execute a command using exec?

"exec" overlays the newly forked process on the current process ; so when I execute the command using exec a new process corresponding to the command will be created and the current process will die.
Eg: Executing "exec com1" on command prompt will execute com1 and return to login prompt since my logged in shell is superimposed with the new process of the command .

Posted by:Richards