LPIC-1 Exam 102 v5 (Linux Administrator) — Question 13

What output is produced by the following command sequence?
echo '1 2 3 4 5 6' | while read a b c; do
echo result $c $b $a;
done

Answer options

Correct answer: C

Explanation

The correct answer is C because the 'read' command takes the first three values from the input line, assigning them to variables a, b, and c. The output format 'result $c $b $a' results in the last three numbers in reverse order, producing 'result: 3 4 5 6 2 1'. The other options do not match this format or value arrangement.