curl-users
Re: how to write to a file with # in it
Date: Sun, 21 Aug 2005 17:06:31 +0530
> You didn't mention on what system or file system you have problems,
Red Hat Linux release 7.2 (Enigma)
Kernel: 2.4.20-20.7smp
curl 7.8 (i386-redhat-linux-gnu) libcurl 7.8 (OpenSSL 0.9.6b) (ipv6 enabled)
> but I just tried on a linux machine nearby:
> $ curl -o 'foo#moo' www.haxx.se
And this is what I got in return
% Total % Received % Xferd Average Speed Time Curr.
Dload Upload Total Current Left Speed
100 3831 100 3831 0 0 2753 0 0:00:01 0:00:01 0:00:00 2661
$ls -l
-rw-r--r-- 1 root root 3831 Aug 21 05:48 foomoo
'#' is missing! :-(
Does it has anything to do with this?
=======================================================
-o/--output <file>
Write output to <file> instead of stdout. If you are using {} or [] to fetch multiple documents, you
can use '#' followed by a number in the <file> specifier. That variable will be replaced with the
current string for the URL being fetched. Like in:
curl http://{one,two}.site.com -o "file_#1.txt"
or use several variables like:
curl http://{site,host}.host[1-5].com -o "#1_#2"
You may use this option as many times as you have number of URLs.
See also the --create-dirs option to create the local directories dynamically.
=======================================================
thanks
Vijoy~
Received on 2005-08-21