This is how you zero pad a numerical variable in bash.
for ((x=1;x< =31;x+=1)); do echo `printf "%02d" $x`; done
Original Article
This entry was posted on Wednesday, July 2nd, 2008 at 11:01 pm and is filed under Code, Command Line, Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Name (required)
Mail (will not be published) (required)
Website
Notify me of followup comments via e-mail