I am trying to increment a filename in a script example name is 000001.txt and I need to keep the leading 0's. I have no problem if the name was 1.txt, 2.txt etc... var=`expr $var + 1`
however how do I keep the leading 0's?
Thanks,
Jerry
On Fri, Oct 17, 2008 at 10:52:15AM -0400, Jerry Geis enlightened us:
I am trying to increment a filename in a script example name is 000001.txt and I need to keep the leading 0's. I have no problem if the name was 1.txt, 2.txt etc... var=`expr $var + 1`
however how do I keep the leading 0's?
printf
On Fri, Oct 17, 2008 at 10:52:15AM -0400, Jerry Geis enlightened us:
/ I am trying to increment a filename in a script example name is 000001.txt
/>/ and I need to keep the leading 0's. I have no problem if the name was />/ 1.txt, 2.txt etc... />/ var=`expr $var + 1` />/ />/ however how do I keep the leading 0's? />/ / printf
perfect - thanks,
Jerry