When I use mapfile with parallel to create an array inside a function the array isn't created properly.
Why is this?
Array creation not in function
mapfile -t arr < <(parallel -j 0 echo ::: {1..5})
declare -p arr
declare -a arr=([0]="1" [1]="2" [2]="3" [3]="4" [4]="5")
Same thing but inside a function
mapRay() { mapfile -t "$1" < <(parallel -j 0 "$2" ::: "$3"); }
mapRay arr echo {1..2}
declare -p arr
declare -a arr=([0]="1")