in reply to printf syntax

Use the special "*" width:
printf "%*s", 10, $some_string;

That will print your string, right justified and padded to 10 spaces. Use -10 if you want left justification.