Can anyone help? I'm trying to pass a vararray as a parameter to a function. But, I can't make it work. Basically, what I"m trying to do is only to display it's content. But I can't figure out the correct syntaxt.
Anyone can help? I'm using bash GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
-bash-4.2$ vi test.sh
#!/bin/bash
function f(){
arr=("$0");
loop
echo key
echo value
end loop;
}
declare -A fooMap=(
["key1"]="value1"
["key2"]="value2"
)
f fooMap