首页 > 解决方案 > “文件意外结束” - 我的代码可能有什么问题?

问题描述

我正在尝试编写 shell 脚本以从 EOSDIS 世界观下载 EarthData。谁能告诉我为什么它一直显示“ data: invalid option --v ”?这是代码:

set inp = 1
set reg = 1

set year = 2020
 
 
#set jul_day = `date +"%j"`
set jul_day=152

set i=205

while ($i>33)

set query_day=`date -v -"$i"d +"%Y-%m-%d"`
echo $query_day
echo $jul_day

if ($inp == 1) then
   set n1 = 'MODIS_Terra'
   set out1 = '.terra.250m.tif'
        else if ( $inp == 2 ) then
            set n1 = 'MODIS_Aqua'
            set out1 = '.aqua.250m.tif'
                else if ( $inp == 3 ) then
                    set n1 = 'VIIRS_SNPP'
                    set out1 = '.viirs.250m.tif'
endif


set t1 = 'https://wvs.earthdata.nasa.gov/api/v1/snapshot'
set t1a = 'REQUEST=GetSnapshot&TIME='

if ( $reg == 1 ) then
# NE Greenland
 set t2 = 'T00:00:00Z&BBOX=200704,-2009088,1093632,-317440&CRS=EPSG:3413&LAYERS='
 set t3 = '_CorrectedReflectance_TrueColor,Coastlines&WRAP=day,x&FORMAT=image/tiff&WIDTH=4458&HEIGHT=8120'
 set out_f = ' Fram_Strait'

endif


set saug = $t1a$query_day$t2$n1$t3
echo $saug
set writ = $out_f$year$jul_day$out1

wget  --no-check-certificate --glob=on $t1'?'$saug  --output-document=$writ


@ jul_day ++
@ i --
end

此代码在 MacBook (Linux) 中运行良好。但是,当我在 Windows 上尝试时,我只会收到一个意外错误。有人可以帮我吗?

标签: shellcommand

解决方案


推荐阅读