Liste des Groupes | Revenir à cu shell |
That said, here's something I stumbled across recently: >In order for the pid "$!" to have been reused for a different process the shell would have needed call "wait()" (or "waitpid()") beforehand. (Otherwise the terminated process would remain a zombie (i.e. an unwaited) process.) Does the shell even call "wait()" or "waitpid()" if given the "set" option "+b"?
>
background job &
...
kill %1 # clean up
>
What happens if the background job has already terminated on its own accord before we reach the kill(1)? Not much, because with job control, the shell knows that no such job exists. If you do this with "kill $!", you signal that PID, which no longer refers to the intended process and may in fact have been reused for a different process. >
Les messages affichés proviennent d'usenet.