niekshas
25th June 2008, 16:34
#well ihawe something like this
Array=(first second)
firstoption=(one two)
secondoption=(11 22)
#now i'm reading like this
For segment in "${Array[@]}"; do
x=$segment"option" #i'm geing something like firstoption
eval t=\${$x[@]} #I hope that t will be array
For opt in "${t[@]}"
echo opt
done
done
###############
well i hope read like all options... but cant... couse t hawe only one value "one two" or "11 22 "
i cnow thats LAME so i'm asking... how i can improve this script ???
Array=(first second)
firstoption=(one two)
secondoption=(11 22)
#now i'm reading like this
For segment in "${Array[@]}"; do
x=$segment"option" #i'm geing something like firstoption
eval t=\${$x[@]} #I hope that t will be array
For opt in "${t[@]}"
echo opt
done
done
###############
well i hope read like all options... but cant... couse t hawe only one value "one two" or "11 22 "
i cnow thats LAME so i'm asking... how i can improve this script ???