I have 5 variables and each variables contains five values.I want to print five lines with the five values from five variables one by one For example
$a=1 2 3 4 5
$b=4 2 3 4 5
$c=8 9 7 6 5
$d= 8 7 6 5 4
$e=5 6 7 3 3
I want to print five lines in this format
My options was a=1,b=4,c=8,d=8and e=5
My options was a=2,b=2,c=9,d=7 and e=6
and so on upto five values.
I got confused in using the loops.Can anyone help me to provide loops in script to obtain the following output.
Using this
awk
command with a bash loop:Output:
If you transpose the matrix, this is really simple, portable, and idiomatic.
Notice how the first column enumerates the
a
values, the second, theb
s, etc.