101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 75


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

Show Answer
Correct Answer: D

In Bash, a variable is assigned a value using the syntax variable_name=value without any spaces around the equal sign. Thus, to set the Bash variable named TEST with the content FOO, the correct command is TEST="FOO".

Discussion

2 comments
Sign in to comment
sis_net_sec
Apr 12, 2022

What is the difference between B and D

Lazylinux
Apr 30, 2022

SPACE, there should be no space and B has space and will not work D is the answer

DuboisNicolasDuclairOption: D
Oct 21, 2023

The command that sets the Bash variable named `TEST` with the content `FOO` is: D. `TEST="FOO"` In Bash, you can assign a value to a variable by simply using the variable name followed by an equal sign and the value, without any spaces around the equal sign. For example, `TEST="FOO"` assigns the value "FOO" to the variable `TEST`.