exam questions

Exam 102-500 All Questions

View all questions & answers for the 102-500 exam

Exam 102-500 topic 1 question 75 discussion

Actual exam question from LPI's 102-500
Question #: 75
Topic #: 1
[All 102-500 Questions]

What information is shown by the echo $? command?

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
CuriousLinuxCat
Highly Voted 4 months, 3 weeks ago
Correct Answer: B ☜ is correct. What does the 'echo $?' command do? It shows the most recently exit code. The command's exit code right before you entered 'echo $?'. Examples: true echo $? 0 false echo $? 1 ls -fasjfhslakfjh echo $? 2 (The two here represents "Misuse of Shell Built-in") See more: https://www.baeldung.com/linux/status-codes https://unix.stackexchange.com/questions/501128/what-does-echo-do
upvoted 8 times
...
iwkno6
Most Recent 4 months ago
B is correct. To test, type a common command and then echo $? and check the output, then type some gibberish and do echo $? and check the output again. it shoudl display the exit code depending on the previous command
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago