As bash does not support multidimensional arrays (?), I need some help with a problem. What I want to do is to assign variable names containing a counter in a loop .
what I want to do is basically something like this:
#!/bin/bash
for i in {1..8}; do
var$i = "some command"
done
echo $var1
echo $var2
....
echo $var8
Basically, every 11'th value in the string $blinfo2 (starting at position 38) should be added to a new variable every time the loop is performed. This should result in variables named cpuarray1, cpuarray2 etc with 16 values in each.
What I want to be put in arrays is the 11'th value in that string, starting from the 38'th value (bold).
This shall then be done 14 times (14 blades in the machine). what I want the script to do is to store the idle CPU% in 14 vectors (16 values = 16 cores), one for each blade.