This article is about the bash Process.
To see how to manage another general linux process, see Linux - Process
While executing in non-interactive mode and while in posix mode, any special builtin like:
exiting with a non-zero status causes the shell to stop execution.
From the bash man page: $ Expands to the process ID of the shell. In a () subshell, it expands to the process ID of the current shell, not the sub-shell.
echo $$
The $$ variable often finds use in scripts to construct “unique” temp file names
BASHPID: Process ID of the current instance of Bash. bash 4
echo $BASHPID
The $PPID of a process is the process ID (pid) of its parent process.
The PID (process ID) of last job run in background