I have difficulties in accepting your first example where you start the job in the background and you say it's leaving you in "mid-air" and you have to press [Enter] to continue.
Note that any output the background script produces will be printed after the shell prompt - giving the illusion of a missing prompt (in fact the shell prompt is already there, but scrolled up). You don't have to press [Enter] to enter the next command!
The 2nd example (exec ... &
) makes no sense at all: The ampersand instructs the shell to start the command as a parallel background process, whereas the exec
instructs the shell to start no new process at all and execute the new command "recycling" the current process. Technically spoken (very simplified): The code of the shell program will be replaced by the code of the called program.
Conclusion:
You don't have to press [Enter] (but it does not harm if you do so)
Since the shell script is started as a parallel task anyway, the ampersand may be omitted.
To use exec
makes absolutely sense, if the command to be started is the last one to be executed by the script anyway, so sacrifying the Shell saves one otherwise useless process.
[added:]
Just one thing came to mind why you may think you have to press [Enter]:
While the shell process is displaying the command prompt (awaiting your next command) there will be no notification about finished background processes at all.
You'll only get the notification when the shell displays the next command promt. This also may lead to the illusion that 'one has to press [Enter] to allow a background process to terminate'.