- 积分
- 33736
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-3-4
- 最后登录
- 1970-1-1
|
发表于 2018-11-30 16:56:09
|
显示全部楼层
#!/bin/csh
#################################################################
# Csh Script to retrieve 2 online Data files of 'ds083.2',
# total 37.07M. This script uses 'wget' to download data.
#
# Highlight this script by Select All, Copy and Paste it into a file;
# make the file executable and run it on command line.
#
# You need pass in your password as a parameter to execute
# this script; or you can set an environment variable RDAPSWD
# if your Operating System supports it.
#
# Contact rpconroy@ucar.edu (Riley Conroy) 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 Authentication.log --save-cookies auth.rda_ucar_edu --post-data'
set opt2 = "email=你的用户名&passwd=你的密码&action=login"
$opt $opt1="$opt2" https://rda.ucar.edu/cgi-bin/login
set opt1 = "-N --load-cookies auth.rda_ucar_edu"
set opt2 = "$opt $opt1 http://rda.ucar.edu/data/ds083.2/"
set filelist = ( \
grib2/2018/2018.01/fnl_20180101_00_00.grib2 \
grib2/2018/2018.01/fnl_20180101_06_00.grib2 \
)
while($#filelist > 0)
set syscmd = "$opt2$filelist[1]"
echo "$syscmd ..."
$syscmd
shift filelist
end |
|