标签:shell补位
printf
printf "%d\n" 1234
结果得到:
001234
6个字符,不足在左边补0(printf默认右对齐),\n表示换行。
@@@@@@@@@@@@@
printf "a%031d\n" 33
shell中保证数值的位宽,不足补零
原文地址:http://twowords.blog.51cto.com/4796957/1812387