[ILUGC] help to understand this bash output

  • From: M K Saravanan <mksarav@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx
  • Date: Sun, 15 Jan 2023 03:02:38 +0800

Hi,
Can someone help me to understand this bash output:

$ echo '1 2 3 4 5 6' | while read a b c; do

echo result: $c $b $a;
done
result: 3 4 5 6 2 1

What logic is used to arrive at that answer?

mks.


---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on libera.chat

Other related posts: