I have a Bash script that I can't figure out how to quote a variable in. Any help would be greatly appreciated.
This code works perfectly:
myfunction() {
for i in "${BASE_ARRAY[@]}"
do
I want to pass the name of my array as a variable to the function so I can reuse it with other arrays. This is the code I am trying that fails:
myfunction() {
for i in "${$1[@]}"
do
Then I pass the following to the function:
myfunction BASE_ARRAY