Linux Foundation Certified System Administrator (LFCS) — Question 117
What is the output of the following command?
for token in a b c; do
echo -n ${token};
done
Answer options
- A. anbncn
- B. abc
- C. $token$token$token
- D. {a}{b}{c}
- E. a b c
Correct answer: B
Explanation
The command iterates over the tokens 'a', 'b', and 'c', outputting each token without a newline due to the '-n' option in 'echo'. This results in the concatenated string 'abc', making option B the correct answer. The other options either misrepresent the output format or include unnecessary characters.