Bash does this for you. It will notify you when the process ends by giving you back control and it will store the exit status in the special variable
$?. It look roughly like this:
See the bash manual about special parameters for more information.
But I asume that you want to do other work while waiting. In bash you can do that like this:
someprocess & will start the process in the background. That means control will return immediately and you can do other work. A process started in the background is called a job in bash.
wait will wait for the given job to finish and then return the exit status of that job. Jobs are referenced by
%+ refers to the last job started. See the bash manual about job control for more information.
If you really need the PID you can also do it like this:
$! is a special variable containing the PID of the last started background process.