Linux Foundation Certified System Administrator (LFCS) — Question 6
What is the output of the following command sequence?
for token in a b c; do
echo -n "$token ";
done
Answer options
- A. anbncn
- B. a b c
- C. "a " "b " "c "
- D. token token token
- E. abc
Correct answer: B
Explanation
The correct answer is B, as the command sequence iterates through the tokens 'a', 'b', and 'c', printing each followed by a space without a newline. Option A is incorrect because it concatenates the tokens without spaces, and options C and D do not match the actual output format.