exam questions

Exam LX0-104 All Questions

View all questions & answers for the LX0-104 exam

Exam LX0-104 topic 1 question 12 discussion

Actual exam question from CompTIA's LX0-104
Question #: 12
Topic #: 1
[All LX0-104 Questions]

When the command echo $? outputs 1, which of the following statements are true?

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

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
linux_admin
2 years, 2 months ago
C. It is the exit value of the command executed immediately before echo The echo $? command in a shell outputs the exit value of the last executed command. In this case, if it outputs 1, it means that the command executed immediately before the echo command terminated with a non-zero exit value. A non-zero exit value usually indicates an error or failure of some sort. The value of the exit status can be used by shell scripts or other programs to determine the success or failure of a previous command. This makes it a useful mechanism for controlling the flow of a shell script or program based on the success or failure of individual commands.
upvoted 1 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