Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wait for all processes with a certain name to finish (in bash)

I would like to wait in linux (Ubuntu 11.10) for a load of processes to finish. Each of these processes has a different pid but the same name. Is it possible to do this?

EDIT:

Perhaps I should specify that I don't necessarily know what the pid are, just the process name.

EDIT:

Thanks for the answers; Kevin's seems to do what I want. However, it doesn't work in the specific application I have, so I've posted a more detailed follow-up question here.

like image 863
Bill Cheatham Avatar asked Nov 07 '11 15:11

Bill Cheatham


1 Answers

wait $(pgrep programName)

Ought to do it.

like image 81
Kevin Avatar answered Nov 03 '22 12:11

Kevin