printf 补位


printf "%d\n" 1234

结果得到:

001234


6个字符,不足在左边补0(printf默认右对齐),\n表示换行。




printf "a%031d\n" 33

wKioL1d-G5igOU3RAAAFhW0fAYQ905.png