pikamon
1
how do you display variable that contain multi line side by side dynamically without knowing the number of variable and line for each variable ?
Example
echo $a
a
b
c
echo $b
1
2
3
echo $c
q
w
e
how to output the result in
a 1 q
b 2 w
c 3 e
RudiC
2
If you have a recent bash, try
paste <(echo "$a") <(echo "$b") <(echo "$c")
a 1 q
b 2 w
c 3 e
1 Like
pikamon
3
hi thx for the reply but for some reason the output got cut off for $a
If the above posted solution is not working then create three temp file and pass it to the paste command.
$echo "$a" > t1
$ echo "$b" > t2
$ echo "$c" > t3
$ paste t1 t2 t3
a 1 p
b 2 q
c 3 r