Wait for all processes with a certain name to fini

2019-05-10 05:46发布

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.

3条回答
Luminary・发光体
2楼-- · 2019-05-10 06:31
wait $(pgrep programName)

Ought to do it.

查看更多
做自己的国王
3楼-- · 2019-05-10 06:32
wait $(pidof processname)

perhaps.

查看更多
在下西门庆
4楼-- · 2019-05-10 06:33

As long as you have the pid of these processes:

wait $pid_of_process

That should do it.

查看更多
登录 后发表回答