#!/bin/csh # ################################################################# # Csh Script to retrieve 3 online Data files of 'ds083.2', # total 71.578 MB. This script uses 'wget' to download data. # # Right click this window and 'Save As' a 'Text File', named as # ds083.2.csh. # # You need to pass in your password as a parameter to execute # this script; or you can set an evnironment variable RDAPSWD # if your Operating System supports it. # # Contact baseball@ucar.edu (Gregg Walters) for further assistance. ################################################################# set pswd = $1 if(x$pswd == x && `env | grep RDAPSWD` != '') then set pswd = $RDAPSWD endif if(x$pswd == x) then echo echo Usage: $0 YourPassword echo exit 1 endif set v = `wget -V |grep 'GNU Wget ' | cut -d ' ' -f 3` set a = `echo $v | cut -d '.' -f 1` set b = `echo $v | cut -d '.' -f 2` if(100 * $a + $b > 109) then set opt = 'wget --no-check-certificate' else set opt = 'wget' endif set opt1 = '-O /dev/null --save-cookies auth.dss_ucar_edu --post-data' set opt2 = "email=llamedo@df.uba.ar&passwd=$pswd&action=login" $opt $opt1="$opt2" https://dss.ucar.edu/cgi-bin/login set opt1 = "-N --load-cookies auth.dss_ucar_edu" set opt2 = "$opt $opt1 https://dss.ucar.edu/datazone/dsszone/ds083.2/" set filelist = ( \ grib1/2007/2007.01/fnl_20070101_12_00 \ grib1/2007/2007.01/fnl_20070101_18_00 \ grib1/2007/2007.01/fnl_20070102_00_00 \ ) while($#filelist > 0) set syscmd = "$opt2$filelist[1]" echo "$syscmd ..." $syscmd shift filelist end rm -f auth.dss_ucar_edu exit 0