wait $(pgrep programName)
Ought to do it.
wait $(pidof processname)
perhaps.
As long as you have the pid of these processes:
wait $pid_of_process
That should do it.