Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI Exam 102-500 Topic 3 Question 72 Discussion

Actual exam question for LPI's 102-500 exam
Question #: 72
Topic #: 3
[All 102-500 Questions]

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

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Graciela
20 days ago
Ah, the old 'read a b c' trick. Classic! I'm going with A, because who doesn't love a little reverse-order action? It's like a secret shell script handshake.
upvoted 0 times
...
Juan
21 days ago
I got this! The answer is definitely A. It's like a little dance with the variables, you know? First, you got your 'c', then your 'b', and finally your 'a'. It's like a shell script shuffle!
upvoted 0 times
...
Linsey
24 days ago
This is a tricky one! I can see the logic behind A, but I'm worried that it might not handle the case where there are fewer than three values. Maybe I should go with B instead, just to be on the safe side.
upvoted 0 times
...
Delila
28 days ago
Hmm, I'm not sure about this one. I was thinking it might be D, which would print all the values in reverse order. But I could be wrong, so I'll go with A just to be safe.
upvoted 0 times
Horace
5 days ago
I'm not sure either, but I'll go with A) result: 3 4 5 6 2 1
upvoted 0 times
...
Bobbye
7 days ago
I believe it's B) result: 1 2 3 4 5 6
upvoted 0 times
...
Bettina
9 days ago
I think it will be A) result: 3 4 5 6 2 1
upvoted 0 times
...
...
Ma
2 months ago
Well, this looks like a typical shell script question. I think the correct answer is A, which will print the third, second, and first values of each line. The 'read a b c' command will split the input into three variables, and we're printing them in reverse order.
upvoted 0 times
Katheryn
11 hours ago
User4: That makes sense, so the output should be result: 3 4 5 6 2 1.
upvoted 0 times
...
Magda
9 days ago
User3: So, it will print them in reverse order.
upvoted 0 times
...
Werner
15 days ago
User2: Yes, the 'read a b c' command will split the input into three variables.
upvoted 0 times
...
Teresita
23 days ago
User1: I think the correct answer is A, which will print the third, second, and first values of each line.
upvoted 0 times
...
...
Billye
2 months ago
But if you look at the command sequence closely, it will output 3 4 5 6 2 1, so I still think it's A.
upvoted 0 times
...
Levi
2 months ago
I disagree, I believe the answer is B.
upvoted 0 times
...
Billye
2 months ago
I think the answer is A.
upvoted 0 times
...
Kenneth
2 months ago
But if you look closely, the command sequence reads the values in reverse order, so the answer should be A.
upvoted 0 times
...
Stefan
2 months ago
I disagree, I believe the answer is B.
upvoted 0 times
...
Kenneth
2 months ago
I think the answer is A.
upvoted 0 times
...

Save Cancel