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
If you transpose the matrix, this is really simple, portable, and idiomatic.
while read -r a b c d e; do : stuff with "$a", "$b", etc done <<____ 1 4 8 8 5 2 2 9 7 6 3 3 7 6 7 4 4 6 5 3 5 5 5 4 3 ____
Notice how the first column enumerates the a values, the second, the bs, etc.
a
b