Table of Contents

Bash - process

About

This article is about the bash Process.

To see how to manage another general linux process, see Linux - Process

Process

Interactive

Non-Interactive

Builtin Stop

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.

Management

Environment variable

$$

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

BASHPID: Process ID of the current instance of Bash. bash 4

echo $BASHPID

$PPID

The $PPID of a process is the process ID (pid) of its parent process.

$!

The PID (process ID) of last job run in background

Documentation / Reference