-2

How to output one number few times with spaces in one line via bash

I have

a=5
b=10

I should output 5 times number 10 with using of variables and with spaces Also, i should capture this in variable

For example, i have to receive this

10 10 10 10 10

And it should be variable, it can be array. But after echo $c, i should receive 10 10 10 10 10

How to do it ?

2
for ((i=1;i<=a;i++)); do export c=$c" ${b}"; done; echo $c
10 10 10 10 10

Not the answer you're looking for? Browse other questions tagged or ask your own question.