emanuele6 1732501025 learn POSIX printf doesn't require support for "*" in formats strings to specify a field width or precision with an argument. The most you can do is inject the argument into the format string, if that is possible; e.g.: printf "%.${n}s\\n" "$str" instead of printf '%.*s\n' "$n" "$var" emanuele6 1732501071 forget emanuele6 1732501128 learn POSIX printf doesn't require support for "*" in format strings for specifying field widths or precisions with an argument. The most you can do is inject the argument into the format string, if that is possible; e.g.: printf "%.${n}s\\n" "$str" instead of printf '%.*s\n' "$n" "$var"