exam questions

Exam LFCS All Questions

View all questions & answers for the LFCS exam

Exam LFCS topic 1 question 82 discussion

Actual exam question from Linux Foundation's LFCS
Question #: 82
Topic #: 1
[All LFCS Questions]

Which of the following command sets the Bash variable named TEST with the content FOO?

  • A. set TEST="FOO"
  • B. TEST = "FOO"
  • C. var TEST="FOO"
  • D. TEST="FOO"
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
Strib
6 months, 3 weeks ago
Selected Answer: D
D is correct
upvoted 1 times
...
rona962
9 months ago
Selected Answer: D
The command that sets the Bash variable named TEST with the content FOO is option D, TEST="FOO". Explanation: Option A, set TEST="FOO", sets the positional parameters of the current shell to TEST=FOO. It does not set the variable TEST. Option B, TEST = "FOO", attempts to run a command named TEST with two arguments, = and "FOO". It does not set the variable TEST. Option C, var TEST="FOO", is not valid Bash syntax for setting a variable. It is likely used in a different shell or programming language. Option D, TEST="FOO", sets the variable TEST to the string FOO. Therefore, to set the Bash variable named TEST with the content FOO, you should use the command TEST="FOO".
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