No not nearly as exciting as you make it out to be
The inverted commas you have placed around "$LIST" has told the interpreter to preserve the whitespace.
So if you have the following scenario:
Code:
dir - u1.sh
- u2.sh
- u2 and 3.sh
- u4.sh
Then by looking at the input in your script:
Here you expected the inverted commas to preserve the whitespace and hence each file above and its newline character have been concatenated together in the variable LIST.
Then when you use the following:
Code:
for i in "$LIST" ; do
Again you have used inverted commas so bash preserves all the whitespace and therefore places all the data into 'i'.
This of course then only has to run the for loop once and do a single echo.