I am running a loop for an array of variables that generates three more variables.i.e for foo in ${bar[@]};    do bar1=$(echo $foo | awk '{print$1}');       bar2=$(echo $foo | awk '{print$2}');       bar3=$(echo $foo | awk '{print$3}');doneHowever when the loop is finished I need the three newly created variables to become arrays themselves that I can run for loops on as well.i.e.for foo in ${bar1[@]}    do echo $foodone^^^^this should show multiple lines.can anyone provide anyway to make this possible?
How can I send multiple options to one variable
bash;shell script
Use      bar1+=($(echo $foo | awk '{print$1}'))i.e., variable+=( value )to add a value to an array.Of course the code to use the bar1 array has to look something likefor foo in ${bar1[@]}do    echo $foodoneOf course you should always quote shell variables(e.g., $foo and ${bar1[@]}) unless you have a good reason not to,and youre sure you know what youre doing. 