List the content of a directory specified by loop indices

前端 未结 2 884
耶瑟儿~
耶瑟儿~ 2021-01-26 11:43

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

<
2条回答
  •  南方客
    南方客 (楼主)
    2021-01-26 12:30

    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).

提交回复
热议问题