cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CR/LF in URL

From: Jamie Lokier <jamie_at_shareable.org>
Date: Tue, 11 Apr 2006 10:31:07 +0100

Jeff Pohlmeyer wrote:
> Using bash, I tried to do something like this:
> ---
> curl -l ftp://ftp.gtk.org/pub/gtk/perl/ | while read FILENAME
> do
> curl -sSO ftp://ftp.gtk.org/pub/gtk/perl/$FILENAME
> done
> ---
> And I get this:
>
> curl: (3) URL using bad/illegal format or missing URL
> curl: (3) URL using bad/illegal format or missing URL
> curl: (3) URL using bad/illegal format or missing URL
> etc...
>
> The problem is that the the ftp LIST response is in CR/LF format,
> and the bash 'read' strips the LF, but not the CR.
>
> I suppose that's my mistake, but it sure took me a while to
> figure out what I was doing wrong! Is there any reason why
> curl shouldn't strip the CR if it finds one?

It would be far more sensible to strip the CRs when outputting the ftp
LIST response.

-- Jamie
Received on 2006-04-14