Loading practice questions
Match the following with reference to Unix shell scripts:
| List-I | List-II |
|---|---|
| (a) $? | (i) Process ID of current shell |
| (b) $# | (ii) All arguments as a single string |
| (c) $$ | (iii) Number of command line arguments |
| (d) $* | (iv) Exit status of last command |
Correct Answer: B — (a)-(iv), (b)-(iii), (c)-(i), (d)-(ii)
Explanation:
Specific shell variables map to strict definitions: $? gives the last exit status, $# gives the argument count, $$ is the current process ID, and $* returns all arguments.