« first day    last day (17 days later) » 

3:17 AM
That's really odd..
 
3:43 AM
I tried to imitate having those files. This is the result of my test:
$ ls -1
temp.sh
trim201001.nc
trim201002.nc
$ cat temp.sh
#!/bin/bash

fname2="trim"
years=(2010)
months=(01 02)
end="nc"

shopt -s extglob
shopt -s nullglob
IFS='|' eval 'pattern="${fname2}@(${years[*]})@(${months[*]}).${end}"'
echo "pattern: ${pattern}"
files=($pattern)
echo "files: ${files[*]}"
$ bash temp.sh
pattern: trim@(2010)@(01|02).nc
files: trim201001.nc trim201002.nc
 
 
8 hours later…
12:03 PM
First of all i want to sincerely thank you for your time..i appreciate your help a lot
this is the code i am using, i would be grateful to tell if something conflicts with each otehr
*otehr
other
lon1=-12 # west
lon2=-11 # east
lat1=54 # south
lat2=55 # north
#R=R
tarfiles=datafile
#echo " Untar the file s"
#time tar -xf $tarfiles
#time tar -xf *.tar
#set -xv
file="wnd10m.gdas."
year='2010'
month='01 02'
ext="grb2"

for((y=$year;y<=$year;y++));
do
for m in $month
do
fname=$file$y$m.$ext
echo " convert into .nc "
cdo -f nc copy $fname $fname.nc

ofile1=$fname.nc
echo "re-format into structured grid 0.5x0.5"
cdo remapbil,r720x361 $ofile1 R$ofile1
cdo remapbil,r720x361 $ofile1 Re$year$m.nc
after adding the term you proposed
i get
./CFSR2netCDF.sh: line 75: $: command not found
./CFSR2netCDF.sh: line 76: pattern:: command not found
./CFSR2netCDF.sh: line 77: files:: command not found

cdo mergetime: Open failed on >02).nc<
No such file or directory
I believe that it does not recognize the files
i check the folder and the files name for the last step that are to be use are
trim201001.nc and trim201002.nc
 

« first day    last day (17 days later) »