lis="a:b:c:d:"
IFS=:
If I run the following code,
for i in "a:b:c:d:";
do
echo the output is $i
done
I get:
the output is a b c d
If I replace "a:b:c:d:" with $lis instead:
for i in $lis;
do
echo the output is $i
done
I have the expected output:
the output is a
the output is b
the output is c
the output is d
I wonder what is wrong, $lis is basically the same as "a:b:c:d"
"$lis"
might be, but$lis
isn't. – muru Jun 06 '19 at 03:11