I could really use arrays in the bourne shell. In order to fake it I'm
trying to tack the subscript onto a common name, that is:
foo0="first"
foo1="second"
foo2="third"
for i in 0 1 2
do
name = foo${i}
echo $name <and the value of the name>
done
This correctly sets name to foo0, foo1, and foo2 but damned if I can get
"first", "second", "third" out of the thing with any combination of ', ", \,
{}, or $.
My real program has many more than 3 foos, and there are going to be about
20 lines of processing inside the for loop. There are also 3 'arrays',
that is, I've got foo[100], bar[100], and blatz[100].
It's not possible to change to another shell, write the routine in C, use
perl, or take any other easy outs. It is possible for me to unroll the
loops, but I'd really like to avoid having 100 blocks of code that differ
only in the variable names.
thanks
jim
--
"I want to die peacefully in my sleep like my grandfather. Not screaming
in terror like his passengers."
San Diego, CA.