dynamic pid?

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?

is it true?

You have a parent process that each time you do a ps -ef and grep for your userid, you will see the same parent, but different children processes.

$ ps -ef|grep unixops
unixops 8075 8070 0 13:53:20 pts/11 0:00 grep unixops
unixops 8070 595 1 13:53:13 pts/11 0:00 -ksh
$ ps -ef|grep unixops
unixops 8077 8070 0 13:53:27 pts/11 0:00 grep unixops
unixops 8070 595 1 13:53:13 pts/11 0:00 -ksh

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.