开发者

Running an array of processes

开发者 https://www.devze.com 2022-12-27 19:33 出处:网络
I have the following array: procs=( \'one a b开发者_StackOverflow社区 c\' \'two d e f\' \'three g h i\'

I have the following array:

procs=(
'one a b开发者_StackOverflow社区 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?


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

精彩评论

暂无评论...
验证码 换一张
取 消