I have function that print lines with spaces and need to loop through the line with a for..in loop. How do I preserve the spaces and not tokenize based on them.
function getTwoThings
{
echo "A B C"
echo "X Y Z"
}
for L in `getTwoThings`
do
echo $L
done
for L in "`getTwoThings`"
do
echo $L
done
Produces either six things or one thing.
A
B
C
X
Y
Z
A B C X Y Z
How do I get it to produce two things?