I need to convert this array:arr=(aa: info { bb: name value 50; bb: surname oth_value 50; bb: age number 3; bb: about text void; })to something like this:arr=((aa: info {) (bb: name value 50;) (bb: surname oth_value 50;) (bb: age number 3;) (bb: about text void;) (}))the goal is to loop through the multidimensional array to be able to perform actions with each array that is inside. For example:for i in ${!arr[@]}; do   echo ${arr[i][0]}   # prints out the first value of each element   echo ${arr[i][1]}   # prints out the second value of each elementdoneWhat I need is to be able to separate the information between bb: and ; and use each of it's elements. For example to echo it out. The only idea I came up with is to put separate the needed information in the arrays inside of the main array (to create multidimensional) and when looping through it, to use the values I need. Basically there will be only three values between bb: and ;. But the number of this bb: and ; sections is unlimited. The aa: info { and the } should be cutted of. I don't need them.
Trying to get the specific information from the array
bash
arr=(aa: info { bb: name value 50; bb: surname oth_value 50; bb: age number 3; bb: about text void; })for ((i=3; i + 4 < ${#arr[@]}; i+=4))do    echo ${arr[i]}    echo ${arr[i + 1]}    echo ${arr[i + 2]}    echo ${arr[i + 3]}doneThis is a straightforward C-style for loop. You can ignore any of the fields you don't want to care about, and change the numbers.Wherever this array originally came from, you'd almost certainly be better off in general using a proper parser on the source text, but this does satisfy the scenario you've described adequately. As soon as it gets more complicated it's going to get much harder, though  it's only because it happens to be purely stepping by four that this works out simply.