- 积分
- 613
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-7-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本人想下载CFSR的数据来run WRF,主要是想使用wget来下载,通过点击下图中的create后出现了如下的一个脚本,本人表示完全看不懂,在此请教一下大家接下来改如何做!先在此谢谢大家了!
#! /bin/csh -f
#
# c-shell script to download selected files from rda.ucar.edu using Wget
# NOTE: if you want to run under a different shell, make sure you change
# the 'set' commands according to your shell's syntax
# after you save the file, don't forget to make it executable
# i.e. - "chmod 755 <name_of_script>"
#
# Experienced Wget Users: add additional command-line flags here
# Use the -r (--recursive) option with care
# Do NOT use the -b (--background) option - simultaneous file downloads
# can cause your data access to be blocked
set opts = "-N"
#
# Replace "xxxxxx" with your rda.ucar.edu password on the next uncommented line
# IMPORTANT NOTE: If your password uses a special character that has special
# meaning to csh, you should escape it with a backslash
# Example: set passwd = "my\!password"
set passwd = 'xxxxxx'
set num_chars = `echo "$passwd" |awk '{print length($0)}'`
if ($num_chars == 0) then
echo "You need to set your password before you can continue"
echo " see the documentation in the script"
exit
endif
@ num = 1
set newpass = ""
while ($num <= $num_chars)
set c = `echo "$passwd" |cut -b{$num}-{$num}`
if ("$c" == "&") then
set c = "%26";
else
if ("$c" == "?") then
set c = "%3F"
else
if ("$c" == "=") then
set c = "%3D"
endif
endif
endif
set newpass = "$newpass$c"
@ num ++
end
set passwd = "$newpass"
#
set cert_opt = ""
# If you get a certificate verification error (version 1.10 or higher),
# uncomment the following line:
#set cert_opt = "--no-check-certificate"
#
if ("$passwd" == "xxxxxx") then
echo "You need to set your password before you can continue"
echo " see the documentation in the script"
exit
endif
#
# authenticate - NOTE: You should only execute this command ONE TIME.
# Executing this command for every data file you download may cause
# your download privileges to be suspended.
wget $cert_opt -O auth_status.rda.ucar.edu --save-cookies auth.rda.ucar.edu.$$ --post-data="email=wangxuejin12@lzu.edu.cn&passwd=$passwd&action=login" https://rda.ucar.edu/cgi-bin/login
#
# download the file(s)
# NOTE: if you get 403 Forbidden errors when downloading the data files, check
# the contents of the file 'auth_status.rda.ucar.edu'
wget $cert_opt $opts --load-cookies auth.rda.ucar.edu.$$ http://rda.ucar.edu/data/ds093.0 ... 090826-20090831.tar
wget $cert_opt $opts --load-cookies auth.rda.ucar.edu.$$ http://rda.ucar.edu/data/ds093.0 ... 090901-20090905.tar
wget $cert_opt $opts --load-cookies auth.rda.ucar.edu.$$ http://rda.ucar.edu/data/ds093.0 ... 090906-20090910.tar
wget $cert_opt $opts --load-cookies auth.rda.ucar.edu.$$ http://rda.ucar.edu/data/ds093.0 ... 090911-20090915.tar
wget $cert_opt $opts --load-cookies auth.rda.ucar.edu.$$ http://rda.ucar.edu/data/ds093.0 ... 090916-20090920.tar
wget $cert_opt $opts --load-cookies auth.rda.ucar.edu.$$ http://rda.ucar.edu/data/ds093.0 ... 090921-20090925.tar
#
# clean up
rm auth.rda.ucar.edu.$$ auth_status.rda.ucar.edu
|
|