Standard input from your terminal is line-buffered so your loop will process each line as it arrives.
To see the output you have shown you could either disable the line-buffering of STDIN (I've never done that and with pretty good reasons) or disable line-buffering of STDOUT (less problematic) or else save your output in the loop to a variable rather than printing directly and then print the entire variable on loop exit.
In any of these cases you will need to send the EOT character to notify the script of the end of input. This is typically ^D
In reply to Re: Copy multiple lines to a loop
by hippo
in thread Copy multiple lines to a loop
by eyekona
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |