LFCS Exam QuestionsBrowse all questions from this exam

LFCS Exam - Question 113


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

Show Answer
Correct Answer: BC

When the command echo $ outputs 1, it indicates that the $ variable being echoed contains the process ID of the current shell. The use of $ in this context is to retrieve the process ID of the shell instance that is running the command.

Discussion

3 comments
Sign in to comment
stef_88Option: C
Mar 26, 2020

If answer C is correct then the Question should have been "echo S?"

Funkslinger
Feb 25, 2022

No, it should actually be... echo $?

Funkslinger
Feb 25, 2022

In use it would actually be "echo $?"

boorceOption: C
Mar 28, 2024

Missing "?" in question :) => echo $? to return exit codes.