参见英文答案 >
How to zero pad a sequence of integers in bash so that all have the same width?8个答案我有一个循环的基本数字,在每次迭代增加变量num 1
@H_403_16@for (( num=1; num<=5; num++ )) do echo $num done
其中输出:
1 2 3 4 5
01 02 03 04 05
不做:
echo 0$num