tags:

views:

18

answers:

1

I have the following array:

procs=(
'one a b c'
'two d e f'
'three g h i'
)

I try run these processes from a loop (using echo instead of eval so I can debug):

for proc in ${procs[@]}
do
  echo $proc
done

I get:

one
a
b
c
two
d
e
f
three
g
h
i

I wanted:

one a b c
two d e f
three g h i

What went wrong?

+1  A: 
for proc in "${procs[@]}"
do
  echo $proc
done
caskey
Wait, is the same as what I tried? I don't notice a difference.
User1
It properly quotes the array variable.
ndim