This has been asked several times, but none of the methods work. I would like to dynamically create arrays with array names taken from the variables. So lets start with just one array for now:
#!/bin/bash
i="aaa"
eval ${i}=("1")
results in
./1.sh: line 3: syntax error near unexpected token `('
./1.sh: line 3: `eval ${i}=("1")'
same result with:
$(eval ${i})=('1')
$(eval echo ${i})=('1')
$(eval "echo ${i}")=('1')
I do not want to eval everything, justthe array name. If it is possible I would like to avoid using eval at all