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}');
done
However 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 $foo
done
^^^^this should show multiple lines.
can anyone provide anyway to make this possible?
bar
array looks like, and what is desired output inbar1
,bar2
,bar3
. – jimmij Aug 27 '15 at 0:27