SyntaxFix
Write A Post
Hire A Developer
Questions
why not printf '%02d' $num? See help printf for this internal bash command.
printf '%02d' $num
help printf