w = 5 p = 3 s = "abcdefg" printf "<%*.*s>\n", w, p, s [download]
In reply to printf() formats by Anonymous Monk