Beginner
Linux & Shell Scripting
Q22 / 100
How do you assign a value to a variable in a bash script?
Correct! Well done.
Incorrect.
The correct answer is B) name="value" (no spaces around the equals sign)
B
Correct Answer
name="value" (no spaces around the equals sign)
Explanation
In bash, variable assignment must have no spaces around "="; "name = value" would instead be interpreted as running a command "name" with arguments "=" and "value".
Progress
22/100