hi, i noticed that the pid of a process can change.. is that true?
like now i do a ps on my terminal.. and there is a list of process with their pids.. and later with the same process, (without qutting and runnign the same process) this time round, their pid are different?
Note that each show pid 8070 (-ksh) but the "grep unixops" has different pids. After completing the requested work (searching for unixops), the child process died. This is normal.
Processes don't change process IDs. However, processes can spawn other processes and each of those will have a different process id.... in turn, those process ids do not change, they are born and they die.
Parent processes spawn child processes and children can also become parents, etc. (like RTM was explaining)
Because we call them parent and child processes and because processes die (and are killed), parent and child processes are the subject of many jokes about "forking children" "killing children" ... "parents killing their children" etc.
... these jokes are normally made by UNIX novices who have just discovered parent/child process relationships.... then after a short time, the vocabulary become natural and the jokes are not (generally) used by 'UNIX adults'...... (mature UNIX users)... we just do the work... so to speak.