Vidyalelo
Computer Science · Q28

UNIX

Engineering and GATE · Computer Science · question 28

Q28

Which of the following special shell variables is used to process number of the last background job?

A.
$!
Answer
B.
$#
C.
$0
D.
$*
E.
None of the above

Answer: Option A

Solution

Answer: Option A
Solution:
In Unix shell scripting, the $! special variable is used to process the number of the last background job. It holds the process ID (PID) of the last command run in the background.
So, $! is the special shell variable used to process the number of the last background job.