Linux Administration
medium

Pregunta de Linux Administration #019e3987

Enunciado de la Pregunta
Linux Administration
#bash-variable-assignment
#variable-syntax
#shell-variables
#no-spaces-around-equals
Medio

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"

Correcto

Explicación Oficial / Explicaciones de la Comunidad

In Bash, the correct syntax to assign a value to a variable is VARIABLE_NAME=value with no spaces around the = sign. The command TEST="FOO" correctly sets the variable TEST to the string FOO.