
		arthurlucas
		
		(usa Ubuntu)
		
		Enviado em 29/05/2014 - 20:58h 
		#!/bin/csh
#################################################################
# Csh Script to retrieve 2 online Data files of 'ds083.2',
# total 31.38M. 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 schuster@ucar.edu (Doug Schuster) for further assistance.
#################################################################
set pswd='lucas88262808'
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.rda_ucar_edu --post-data'
set opt2 = "email=arthur.lucas.melo@gmail.com&passwd=$pswd&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/2014/2014.01/fnl_20140101_00_00 \
  grib2/2014/2014.01/fnl_20140101_06_00 \
)
while($#filelist > 0)
 set syscmd = "$opt2$filelist[1]"
 echo "$syscmd ..."
 $syscmd
 shift filelist
end
rm -f auth.rda_ucar_edu
exit 0
Gostaria de modificar o código acima para bash, quando eu coloco #!/bin/bash na primeira linha da erro, o que eu posso fazer ? Não entendo esse código!!