curl-users
Re: Pipe in the URL ?
Date: Fri, 14 Jul 2006 10:19:27 +0100
At 09:16 14/07/2006, Jochen Roderburg wrote:
>Alexander Lazic schrieb:
>>Hi,
>>On Fre 14.07.2006 02:35, www.mail wrote:
>>>
>>>Please could you tell me if it is possible to do something like:
>>>
>>>echo "http://www.somewebsite.com/" | curl --url -
>>>
>>>because I'd like to download a URL which is displayed by a console
>>>application, without having to create an intermediate file which
>>>contains the URL.
>
>You can put the URLs in a "config-file", which can pe piped into curl.
>They must, however, come in the form --url http://www.somewebsite.com/
>
>Complete example:
>
>echo --url http://www.somewebsite.com | curl --config -
>
>This example commandline works "as is" in Linux and in Windows.
>
>Most certainly you would also want the --remote-name option which
>assures that the local files get the same names as the remote ones:
>
>echo --url http://www.somewebsite.com | curl --remote-name --config -
Hi,
Thanks to all who replied.
I only need to download a single web page and then pipe it into
another program, so I don't need --remote-name, but the need for
--url in the piped input means I have to use sed as an extra
step. But that's OK.
So I'm using:
echo http://www.somewebsite.com | sed "s/\(.*\)/--url \1/" | curl --config -
Thanks for your help.
Regards,
Jonny
Received on 2006-07-14