From the BASH pages:
When a script is run using source it runs within the existing shell, any variables created or modified by the script will remain available after the script completes. In contrast if the script is run just as filename, then a separate subshell (with a completely separate set of variables) would be spawned to run the script.
But what happens if I run
. myscript &
Does it run as a subshell in this case? What's the difference between . myscript &
and ./myscript &
?