[Linux-disciples] Using curl

Adam Kessel linux-disciples@bostoncoop.net
Tue, 27 Jan 2004 10:27:10 -0500


It doesn't work quite like that. You're assuming there's some way to know
what files exist on the other end that start with MS1234567-MS1234567;
unless the path actually provides a file index, there's no way to know.
And obviously it would be absurd for your curl statement to try every
conceivable combination of valid URL characters starting with the given
string.

The way curl works is you can do things like:

curl http://blah/.../MS1234567-MS7890123[0-99].pdf

To get everything that starts with that string and ends with anything
between 0 and 99, inclusive.  You can also do this for characters, or
combinations, etc., e.g.:

curl http://blah/.../MS1234567-MS7890123[A-Z].html

or

curl http://blah/.../MS1234567-MS7890123.{html,pdf,txt}

etc..

What you're requesting with unlimited wildcard expansion would be
impossible, if you think about it.  

On Tue, Jan 27, 2004 at 09:34:28AM -0500, Stephen R Laniel wrote:
> My understanding is that curl can download URLs with regexes in
> them. At my job right now, being able to loop through a list of
> strings that look like
> 
> MS1234567-MS7890123
> 
> and download the corresponding files
> 
> MS1234567-MS7890123*.pdf
> 
> would be extremely handy and a great time-saver. Yet I can't seem
> to get the following to work:
> 
> curl http://blah/.../MS1234567-MS7890123*.pdf
> 
> The error I'm getting back from the server suggests that the '*'
> is getting passed as a literal '*', rather than getting
> interpreted within curl as a regex.
> 
> Help, please? This would probably save me a few hours of labor.
> 
> Thanks,
> Steve
> 
> -- 
> Stephen R. Laniel
> http://laniels.org/
> 
> _______________________________________________
> Linux-disciples mailing list
> Linux-disciples@bostoncoop.net
> http://bostoncoop.net/mailman/listinfo/linux-disciples

-- 
Adam Kessel
http://bostoncoop.net/adam