like multi thread process done wai" /> like multi thread process done wai" /> like multi thread process done wai"/>

how to using Dynamic Value in bash script

22 views Asked by At

I make some script Like this

#!/bin/bash
function AA() {
    i=$1
    for j in {0..100}; do
       declare AA_$j_$i="$j $i" &     # -> like multi thread process
    done
    wait
    for k in $(seq 0 $i); do
        Val=$(eval echo "AA_$j_$i")
        echo $Val
    done
}
for i in {0..100}; do
    AA ${i}&    
done
wait

this script didn't work ( can't print line )

it's like 2-dimensional array but bash don't have multi-dimensional array

Please help me ~!

0

There are 0 answers