Answer C:
a is assigned the value 1, b is assigned the value 2, and c gets the rest of the line "3 4 5 6". You print out c (3 4 5 6), then b (2), then a (1), giving you output you see
Your explanation is odd, but I tested it and it is true:
echo '1 2 3 4 5 6' | while read a b c d e f; do echo result $c $b $a; done
result 3 2 1
since it proves that a=1, b=2 and c=3 (which in the original question above would correspond to the remainning 3 4 5 6, read also respected the spacing!)
because c is the last value the rest of the numbers are assigned to it: 123456 abc
So a is 1, b is 2, c is 3456. If we had 123456 abcd..the output would have been a for 1 b for 2 ,3 for and c, and d 456.
adjust:
echo '1 2 3 4 5 6' | while read a b c; do
echo result $c $b $a;
done
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
mustache
Highly Voted 3 years, 11 months agoblk_542
1 year, 1 month ago[Removed]
1 year, 1 month agothanux
1 year, 12 months agoiwkno6
2 years, 10 months agobrrbrr
Highly Voted 3 years, 11 months agofjcsanchez
Most Recent 4 months, 2 weeks agoM_ukesh8
7 months, 2 weeks agoklever
1 year, 6 months agobestiutza
1 year, 8 months agolucaverce
2 years, 1 month agoclaudiodz
3 years, 3 months ago