$!
contém o ID do processo do pipeline de segundo plano executado mais recentemente. De man bash
:
Special Parameters
The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed.
...
!
- Expands to the process ID of the most recently executed background (asynchronous) command.
Por exemplo:
$ sleep 60 &
[1] 6238
$ echo "$!"
6238