101-500 Exam QuestionsBrowse all questions from this exam

101-500 Exam - Question 48


What output will be displayed when the user fred executes the following command? echo 'fred $USER'

Show Answer
Correct Answer: D

When the user executes the command echo 'fred $USER', the single quotes around 'fred $USER' will prevent the shell from interpreting the $USER variable, treating it as a literal string. Therefore, the output will be exactly what is inside the single quotes, which is fred $USER.

Discussion

4 comments
Sign in to comment
kleverOption: C
Oct 11, 2022

single quotes will suppress the special meaning of $ sign and treat it literally outputting what literally is inside of the single quotes

blk_542Option: D
Nov 17, 2022

D supposed to be correct, but actually the question is wrongly written: `fred $USER' command would output a > prompt since it is mixing 2 quotation types. It supposed to be 'fred $USER' (single quotation type), this is easy to test and result are the same with a regular user and root.

Cybersec1989Option: D
Sep 26, 2022

Correct Tested

NinymoOption: D
Mar 24, 2024

Answer: D