I have the following:
#!/bin/sh
n=('fred' 'bob')
f='n'
echo ${${f}[@]}
and I need that bottom line after substitutions to execute
echo ${n[@]}
any way to do this? I just get
test.sh: line 8: ${${f}}: bad substitution
on my end.
You can do variable indirection with arrays like this:
As soulmerge notes, you shouldn't use | |||||||||
|
You could
BTW: Your first line should be | |||||||||||||||||
|