Re: Download tool for multiple files or wildcards in http

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> As for the script to pipe to wget, I'm getting errors with that

Now that I've got the skeleton format for the naming convention, using
your example of

    www.loc.gov/nls/braille/12269v01.brf

(which I assume is via HTTP, rather than FTP, and for this example, that
there are three of them, ending 01.brf, 02.brf, and 03.brf) you should
be able to use

    seq 1 3 |
    sed "s@.*@http://www.loc.gov/nls/braille/12269v0&@"; |
    wget -i - --http-user="my_username" --http-password="my_password"

(all on one line, broken at the pipes to prevent my cursed mailer from
breaking it in the wrong places)  You'll have to include your wget
credentials in the wget part of the command.  This may have been the
error you were getting back in your first try--just tack it on the end
(the --http-user and --http-password, as described in the man pages for
wget).

You can try each piece progressively.  The "seq 1 3" should just output
the numbers 1 through 3.  Add the sed statement, and you should get the
list of URLs to download for your verification.  If you're using
"screen", you can copy and paste one of these composited URLs onto a
single command line with wget, to just get that one file.

If you've got more than 9 items, "seq" can produce zero-padded results
to make your job easier, so if you've got, say, War And Peace (or some
other huge tome, with 13 parts in this example) you could use

    seq -w 1 13 |
    sed "s@.*@http://www.loc.gov/nls/braille/12269v&@"; |
    wget -i - --http-user="my_username" --http-password="my_password"

(again, all on one line).  If you use FTP rather than HTTP, just make
the obvious change of text in there.  Oh, and you'll want to use your
own username and password there. (grins)

Hope this gets you sent off in the right direction.  Oh, and make sure
that you've got all that punctuation in those commands...miss any one of
them, and it's prone to holler at you.  At least it won't hose your box.
Feel free to fire back any questions.  Best wishes,

-tim








_______________________________________________

Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list

[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]