Bash /
ZeroPaddingFor file names, it is often quite convenient to pad small numbers with zeros in order to have them all sort nicely. It can be a pain to deal with Printf function:$ i=99 $ printf "%05d\n" $i 00099 You can use the -v flag to store the output in another variable: $ i=99 $ printf -v j "%05d" $i $ echo $j 00099 Bash innate handling:for i in {00001..99999}; do echo $i done 00001 00002 ... 09999 ... 99999 |