Table of Contents

What is the Ampersand (&) in the Bash Shell ? ie the Asynchronous, Parallel control operator

About

The Ampersand (&) is:

and the shell:

Example

The format for running commands in the background is:

command1 & [command2 & ...]
startdemo.sh&

How does it work ?

Where is the output redirected?

When job control is not active (see Job Control), the standard input for asynchronous commands, in the absence of any explicit redirections, is redirected from /dev/null.

Process

The process inherits stdout/stderr from the shell (so it still writes to the terminal).

If the shell received a SIGHUP, it also sends a SIGHUP to the process. Depending on the shell and possibly on options set for the shell, when terminating the shell it will also send a SIGHUP to the process.