exec executes the specified command, replacing the current process, rather than starting a new subprocess.
If you type
bash -l
at the shell prompt, it will invoke the new shell process ( -l makes it the login shell). If you exit this shell process, you will return to the original shell process.
Enter
exec bash -l
means the new shell process replaces your current shell process. It is probably a little less resource intensive.
The reason for this is probably so that the new shell installs its environment (reading your .bashrc , .bash_profile , etc.).
See the bash documentation for more information:
(You should read the manual on your own system by typing info bash .)
source share