wait
Bashのジョブコントロール管理に用いることができるBashのビルトインコマンド。
引数が指定されていない場合、実行中のすべてのバックグラウンドジョブと、直前に実行されたプロセス置換のプロセスを待機する。
If no options or ids are supplied, wait waits for all running background jobs and the last-executed process substitution, if its process id is the same as $!, and the return status is zero.
https://www.gnu.org/software/bash/manual/bash.html#index-wait
https://uec.usp-lab.com/JOURNAL/CGI/JOURNAL.CGI?POMPA=KAIGAN_journal09
When the shell is waiting for a job or process using the wait builtin, and job control is enabled, wait will return when the job changes state. The -f option causes wait to wait until the job or process terminates before returning.