Name

wait

Synopsis

                  wait [ID]

Pause in execution until all background jobs complete (exit status 0 will be returned), or until the specified background process ID or job ID completes (exit status of ID is returned). Note that the shell variable $! contains the process ID of the most recent background process. If job control is not in effect, ID can only be a process ID number. See Section 7.6.

Example

ait $!      Wait for last background process to finish

Get Linux in a Nutshell, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.