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, the command gets executed on the current shell without creating any new processes.

Eg: Executing “exec  ls”  on command prompt will execute ls and once ls exits, the process will shut down

Category: Shell Scripting Interview Questions.