What is 12942?

In the following command and its output

$ echo $$
12942

What is 12942?

In the following command and its output

$ echo $$
12942

What is 12942?

A.
the process ID of the echo command

B.
the process ID of the current shell

C.
the process ID of the last command executed

D.
the process ID of the last backgrounded command

Explanation/Reference:
see http://tldp.org/LDP/abs/html/internalvariables.html
$?    Exit status of a command, function, or the script itself
$$    Process ID (PID) of the script/process itself
$_    Special variable set to final argument of previous command executed.
$!     PID (process ID) of last job run in background



Leave a Reply 0

Your email address will not be published. Required fields are marked *