1 exec Builtin
Do not create a child shell, start a new script on the original process, but it will clean up the environment of the old shell, so it does not inherit from the original shell, execute the new script in a clean environment. Exit the current shell after execution is complete.
2 Source Builtin
Do not create a child shell and execute the source script on the original process. The execution environment of the script is the same as that of the original shell.
3 bash filename or./filename
Create a child shell.
Child shells can inherit environment variables, current working directory, open file identifiers, standard input, standard output, and standard error output from the parent shell.
Variables other than environment variables are not inherited.
4 $ (XXX) and ' xxx ', command replacement
Execute in the child shell.
Bash Shell and process