in reply to printf with variable display width

That's one way to do it. I prefer the clearer method shown at sprintf: (minimum) width.

The equivalent would then be:

printf "%*d", $a, $b;

-QM
--
Quantum Mechanics: The dreams stuff is made of