shell - “文件意外结束” - 我的代码可能有什么问题?
问题描述
我正在尝试编写 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 上尝试时,我只会收到一个意外错误。有人可以帮我吗?
解决方案
推荐阅读
- mysql - 在查询错误 2013 期间丢失与 MySQL 服务器的连接
- java - testcontainer启动后如何覆盖集成测试中application.properties中定义的端口?
- python - python for loop MIME sendmail 发出相同的内容
- hive - Google DataProc Hive 和 Presto 查询不起作用
- python-3.x - 缺少 scikit-learn 软件包
- python - Anaconda 中的 scipy.special 现在在哪里?
- javascript - 盖茨比:试图从前端获取图像路径但得到这个“类型错误:无法读取未定义的属性'图像'”
- python - SciPy 的最小化根本没有迭代
- linux - 如何根据标题名称添加两列并根据标题名称将结果粘贴到第三行?
- visual-studio-code - 如何让vscode解析不同目录下的java文件