in reply to Getting PID and Process Name

getppid() returns the process ID of the parent. As indicated by others, use $$ to get the process ID of the current process.

Abigail