Linux Foundation Certified System Administrator (LFCS) — Question 4
When the command echo $ outputs 1, which of the following statements is true?
Answer options
- A. It is the process ID of the echo command.
- B. It is the process ID of the current shell.
- C. It is the exit value of the command executed immediately before echo.
- D. It is the exit value of the echo command.
Correct answer: C
Explanation
The correct answer is C because the command echo $ outputs the exit status of the last command executed before echo, which in this case is 1. Options A and B are incorrect as they refer to process IDs, and option D is wrong because it pertains to the exit status of the echo command itself, not the preceding command.