I\'m working with numerical weather forecast named as follow:
sub_gfsanl_4_2011MMDD-IIII-FFFF.grb2
-MM stands for month from 01 to 12
<
You cannot use ${mi}${di}
in shell. They are Fortran variables, not shell variables. You must put the numbers into the string inside Fortran. Use some of the established methods. They were treated here many times in Convert integers to strings to create output filenames at run time and its duplicates (see Related on the right).