What is the difference between $$ and $!?

$$ gives the process id of the currently executing process whereas $! shows the process id of the process that recently went into background.

Category: Shell Scripting Interview Questions.