-2

I have this data in text file:

-O BNU-ESM-pr-Historical-19560101-19601231.nc https://dataserver.nccs.nasa.gov/thredds/ncss/bypass/NEX-GDDP/bcsd/historical/r1i1p1/pr/BNU-ESM.ncml?var=pr&north=55&west=72&east=136&south=16&horizStride=1&time_start=1956-01-01T12%3A00%3A00Z&time_end=1960-12-31T12%3A00%3A00Z&timeStride=1

I am using this code for a .sh file:

#!/bin/bash
while read -r line; do wget $line; done < pr_china.txt

Result of the command in BASH:

ahmad@ahmad:/mnt/c/script_sh_files$ ./pr_china.sh
--2018-12-29 23:10:30--  https://dataserver.nccs.nasa.gov/thredds/ncss/bypass/NEX-GDDP/bcsd/historical/r1i1p1/pr/BNU-ESM.ncml?var=pr&north=55&west=72&east=136&south=16&horizStride=1&time_start=1956-01-01T12%3A00%3A00Z&time_end=1960-12-31T12%3A00%3A00Z&timeStride=1%0D
Resolving dataserver.nccs.nasa.gov (dataserver.nccs.nasa.gov)... 2001:4d0:2418:2800::a99a:9229, 169.154.146.41
Connecting to dataserver.nccs.nasa.gov (dataserver.nccs.nasa.gov)|2001:4d0:2418:2800::a99a:9229|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-12-29 23:10:33 ERROR 400: Bad Request.
halfer
  • 19,824
  • 17
  • 99
  • 186
  • 1
    Your Question itself is not clear. – Vishwa Ratna Dec 29 '18 at 15:41
  • Welcome to Stack Overflow. Please read https://stackoverflow.com/help/how-to-ask for guidance on how to ask a question which will get a response. This question isn't clear, and will likely be removed – Mikkel Dec 29 '18 at 21:12

1 Answers1

0

Run dos2unix on your pr_china.txt file before you use it.

See: How to remove %0D from end of URL when using wget?

AAber
  • 1,562
  • 10
  • 14