LPIC-1 Exam 102 v5 (Linux Administrator) — Question 56
What information is shown by the echo $? command?
Answer options
- A. The process ID of the echo command.
- B. The exit value of the command executed immediately before echo.
- C. The process ID which will be used for the next command.
- D. The exit value of the echo command.
- E. The process ID of the current shell.
Correct answer: B
Explanation
The command echo $? outputs the exit status of the last executed command prior to echo, which is why option B is correct. The other options incorrectly describe outputs related to process IDs or the echo command itself, which do not apply in this context.