title: curl: (3) URL using bad/illegal format or missing URL in bash Windows
body: <p>I am trying to download PDF files from a list of URLs in a .txt file, with one URL per line. ('urls.txt')</p>
  <p>When I use the following command, where the URL I used is an exact copy-paste of the first line of the .txt file:</p>
  <pre><code>$ curl http://www.isuresults.com/results/season1617/gpchn2016/gpchn2016_protocol.pdf -o 'test.pdf'
  </code></pre>
  <p>the pdf downloads perfectly. However when I use this command:</p>
  <pre><code>xargs -n 1 curl -O &lt; urls.txt
  </code></pre>
  <p>Then I receive a 'curl: (3) URL using bad/illegal format or missing URL' error x times the amount of URLs listed in the .txt file. I have tested many of the URLS individually, and they all seem to download properly.</p>
  <p>How can I fix this?</p>
  <p>Edit - the first three lines of urls.txt reads as follows:</p>
  <pre><code>http://www.isuresults.com/results/season1718/gpf1718/gpf2017_protocol.pdf
  http://www.isuresults.com/results/season1718/gpcan2017/gpcan2017_protocol.pdf
  http://www.isuresults.com/results/season1718/gprus2017/gprus2017_protocol.pdf
  </code></pre>
  <p>SOLVED: As per the comment below, the issue was that the .txt file was in DOS/Windows format. I converted it using the line:</p>
  <pre><code>$ dos2unix urls.txt
  </code></pre>
  <p>and then the files downloaded perfectly using my original line of code. See this thread for more info: <a href="https://stackoverflow.com/questions/39527571/are-shell-scripts-sensitive-to-encoding-and-line-endings">Are shell scripts sensitive to encoding and line endings?</a></p>
  <p>Thank you to all who responded!</p>