I see that similar things have been asked but no solution has worked for me yet. I have a while loop reading through some lines. I want to put certain parts of each line in an array for that line. So I'm trying to have it setup an X amount of arrays depending on how many lines come back. So I would have an array set of "logs_1, logs_2, logs_3" etc. But I keep getting syntax errors when trying to use a variable in the array name. Is there another way to create sequential arrays dynamically? I feel like I'm missing something simple here. A sample of what I'm trying is below, this was just testing to setup the arrays with the correct names.
while read line ; do
(( n++ ));
logs_"&n"=(test1 test2 test3)
echo ${logs_"$n"[*]};
done
Any help is appreciated.