BASH: Keeping/replacing leading zeros with BC
So I have made a script for copying a file with a name like IMG_2012_00754.tif and making incremental file names, so you can specify how many copies you want etc.
Now the problem is with file names like the above you get:
IMG_2012_00754.tif
IMG_2012_755.tif
IMG_2012_756.tif
For the purpose of this script keeping those leading zeros is important, and the script will be used on many different file name formats so the length of that last field is not a certain length (I can't force a field length of 5)
Is there anyway to stop BC from removing those leading zero's when I +1 to that field? Can I +1 with awk and keep them?
|