When you fork a command with "&", but do not use "wait", will bash call wait(3) when the command terminates? In other words, will the PID possibly be reused before the shell exits?
If "some_command" completes before sleep, is it possible that the PID could be reused before "kill" executes? That could get quite nasty. I wouldn't think that would be the case because you could theoretically use ''wait "$pid"'' 10 lines later, and would still need to get the correct exit status. I'm just looking for confirmation, couldn't find it in the docs.