Exam LFCS All QuestionsBrowse all questions from this exam
Question 140

What is the output of the following command?

for token in a b c; do

echo -n ${token};

done

    Correct Answer: B

    The output of the command 'for token in a b c; do echo -n ${token}; done' will be 'abc'. The 'for' loop iterates over the tokens 'a', 'b', and 'c', and 'echo -n ${token}' prints each token without a newline in between. Hence, the output is the concatenation of 'a', 'b', and 'c' resulting in 'abc'.

Discussion
Greenmile84Option: B

~$ for token in a b c; do > echo -n ${token}; > done abc