LPIC-1 Exam 101 (Linux Administrator) — Question 15
Which of the following command sets the Bash variable named TEST with the content FOO?
Answer options
- A. set TEST="FOO"
- B. TEST = "FOO"
- C. var TEST="FOO"
- D. TEST="FOO"
Correct answer: D
Explanation
The correct answer is D, as this is the proper syntax for setting a variable in Bash without spaces around the equal sign. Options A, B, and C are incorrect due to syntactical errors, such as using 'set' or spaces around the equal sign, which are not valid in Bash variable assignment.