How to return pid of a last command in Linux / Unix

Originally published at:

I need to find and return the PID of the last command executed in Linux. How do I return the PID of command in Linux?

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki