What output will the following command sequence produce?

What output will the following command sequence produce?
echo ‘1 2 3 4 5 6’ | while read a b c; do echo result: $c $b $a; done

What output will the following command sequence produce?
echo ‘1 2 3 4 5 6’ | while read a b c; do echo result: $c $b $a; done

A.
result: 1 2 3 4 5 6

B.
result: 3 4 5 6 2 1

C.
result: 3 2 1

D.
result: 6 5 4

E.
result: 6 5 4 3 2 1

Explanation:
remaining numbers on line / in stream (3 4 5 6) are stored in c
and output backwards
c (3 4 5 6) b (2) a (1)



Leave a Reply 1

Your email address will not be published. Required fields are marked *