Hello all,

I've been using curl for a lot of things that involve sequences and
lists (like http://www.example.com/images/img_01[23-45].jpg), but I
really like the queuing and batching and scheduling abilities of lftp
for all sorts of practical reasons.

I tried for a while to come up with some way to achieve sequences and
lists in lftp, and the best I could come up with was the following:

        alias curlq "eval -f \"source -e \\\"echo $1 | xargs -n 1 echo
queue $0\\\"; jobs\""

The way I use it is:

        curlq get http://www.example.com/images/img_01{23..45}.jpg

This uses the bash shell's ability to expand such sequences and lists
(the syntax is different and it does not 0-pad the output even if you
ask for it, but otherwise it is conceptually the same).  It then
passes that expanded list or URLs to xargs which produces on "queue
get URL" for each URL in the expansion.

Are there any better ways to do this?

Thanks,

Sitaram

Reply via email to