Reputation: 1408
I want to loop throgh years and months and insert them in the wget command:
for f in [from 1983.07 to 2017.06]; do wget https://www.ncei.noaa.gov/thredds/fileServer/cdr/isccp_hgm_agg/files/isccp-basic/hgm/ISCCP-Basic.HGM.v01r00.GLOBAL.$f.99.9999.GPC.10KM.CS00.EA1.00.nc;done
Upvotes: 0
Views: 70
Reputation: 782066
Assuming you're using bash
, you can use ..
to generate a sequence of numbers.
It won't leave leading zeroes in numbers, so you need to handle the 1-digit and 2-digit months separately.
For the ranges that include full years, you can combine a year
for f in 1983.0{7..9} {1984..2016}.0{1..9} {1983..2016}.{10..12} 2017.0{1..6}; do
wget "https://www.ncei.noaa.gov/thredds/fileServer/cdr/isccp_hgm_agg/files/isccp-basic/hgm/ISCCP-Basic.HGM.v01r00.GLOBAL.$f.99.9999.GPC.10KM.CS00.EA1.00.nc"
done
Upvotes: 1