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
You can try this:
I'm not sure I understand the question exactly (edited thanks to your comments)
which may be what you need? cat and wildcards is nice but would it keep the same order?
edited again: But then, the wildcard choice is much simpler
your_command grid_20[01][0-9][01][0-9].grb2.nc
if you need them only in ascending order (will that always be the case with the wildcards?)