multiple files with the same name grid_200001.grb2.nc with only one components changing and that is the month grid_200010.grb2.nc. I would like to use them all simultaneously as input files
An example of what I am hoping to achieve is
fname="grid_"
year="2010"
month="01 02 03 04 05 06 07 08 09 10"
ext="grb2"
end="nc"
for((y=$year;y<=$year;y++));
do
for m in $month
do
ifile=$fname$y$m.$ext.$end
>>merge $ifile $ifile ... ofile
example of the desired command i would like to have is
>> merge grid_200001.grb2.nc grid_200002.grb2.nc ....grid_200012.grb2.nc ofile
I would like all the files i have available as input files inputs at the same time
ofilewould be overwritten in every loop. Is that intended? Also, please indent your merging command properly so we can tell which loop body you want to run it. Why as well iscatnot applicable?cat ifile1 ifile2 > ofiledone) and -indent- it well so we'd know more how you intend to merge it? As you see your assignment withifileand yourmergecommand is aligned with the innerforloop.