0

I want to repeat the same argument $i for the instances 03-12. I'm really trying to use some nco operators - but the printf statement is hanging me up. I'm trying to use an netcdf operator on it - where these outputs of the printf are the input files to the command. While this works now with the printf statements, it's not piping into the netcdf command. Which goes as: ncea -v T,U inputfiles outputfile

#!/bin/csh                                                                                                                                                                                                                                             
set i = 1
while ($i < 2)
    ncea -v T,U
    foreach j ( {3,4,6,7,8,9,10,11,12} )
        `printf O3_BDBP_1979ghg.cam.h0.00%02d-%02d.nc $j $i `
    end

    O3_BDBP_1979.nc
    @ i = $i + 1
end

Other printf statements I've tried are

ncea -v T,U `printf O3_BDBP_1979ghg.cam.h0.00{03,04,05,06,07,08,09,10,11,12}-%02d.nc $i` O3_BDBP_1979.nc
ncea -v T,U `printf O3_BDBP_1979ghg.cam.h0.00{03,04,05,06,07,08,09,10,11,12}-%1$02d.nc $i` O3_BDBP_1979.nc
dianei
  • 31
  • 4
  • I posted this one earlier (http://stackoverflow.com/questions/18832102/repeat-printf-arguments) and while the `printf ' statements now work, it doesn't work with having the printf statments being the input to the netcdf operator (which is really what I'm trying to accomplish). I was just trying to break it down into simple tasks as first. – dianei Sep 16 '13 at 18:46
  • Just FYI, I'm the one who suggest a separate question to address the netcdf issue. – chepner Sep 16 '13 at 18:46
  • Yeah, sorry for being trigger happy with the close vote. It is redacted now. – tripleee Sep 16 '13 at 18:48

0 Answers0