Two ways:
You need to wrap the variable name in curlies to prevent the 's' being taken as a part of it:
$space = 5; printf "%${space}s\n", 'x';; x
$space = 5; printf "%*s\n", $space, 'x';; x
In reply to Re: printf syntax
by BrowserUk
in thread printf syntax
by nate_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |