| + print Direct use
print ?!?!? There are only `echo's in this script. What a strange
way of tracing a script.
| Direct use
| {One}
| {line}
| {Two
| lines}
This is correct.
| Indirect Use with Quotes
| {One}
| {line}
| {Two
| lines}
This is correct.
| Indirect Use without Quotes
| {line}
| {Two
| lines}
This is *incorrect*.
We have
foo="One line"
: ${foo2=$foo}
for i in $foo2
do
echo "{$i}"
done
so apparently on the *last* member of $foo was passed to foo2.
| Direct use
| {One}
| {line}
| {Two}
| {lines}
Correct.
| Indirect Use with Quotes
| {One}
| {line}
| {Two}
| {lines}
Correct.
| Indirect Use without Quotes
| {line}
| {lines}
Very *incorrect*. This corresponds to
| foo="One line"
| bar="Two
| lines"
|
| IFS="$space$tab$nl"
|
| : ${foo4=$foo}
| : ${bar4=$bar}
|
| for i in $foo4
| do
| echo "{$i}"
| done
|
| for i in $bar4
| do
| echo "{$i}"
| done
So indeed it seems that your shell is losing the first item(s?) of the
rhs, items being separated by the IFS.
It is surprising, btw, that your shell didn't complain of anything.
Is there anybody here with an Ultrix who could run the script I sent?
There are Ultrices at Cygnus, right? I'd like to be sure of the
behavior of Ultrix before deciding of the right fix.