I have array1
, array2
and a function.
I am trying in a for j=0 to ARRAY_SIZE
loop to get the data from array2[j]
, pass it to a function and the returning output store it in array1[j]
.
Below is the part of the code that I am working on:
exec 3>&1
${ppart_block_fstype[$i]}=_ppart_block_fstype < <(
for i in $(eval echo {0..$ARRAY_END})
do
if [[ ppart_block_alloc[$i] -eq "ALLOC" ]]
then
printf "%s\n" "${ppart_block_num[$i]}" >&3
fi
done)
exec 3>&-
_ppart_block_fstype
is the function that I have previously defined and will return an output that I will store in array ppart_block_fstype
.
The problem of above function is that is using some "heavy tools", hence is not really possible to invoke it at every loop cycle.
This! was a good starting point, but I am stuck on how to make $i
visible out of the subshell, and I am also not sure if I am invoking < <( )*
in the correct way.