I'm trying to accumulate formatted string in a variable. Something similar to:
for i in 1 2 3; do
a="${a} `printf "%-10s %s" "hello" "world"`"
done
However, when I echo the output, it doesn't preserve the format, even when I use the -e or -n flags along with the echo command. How should I do that?
Thanks