TinyApps.Org
Small is beautiful


 HOME

  0. Internet
  1. Text
  2. Graphics
  3. System
  4. File
  5. Misc
  6. Palm
  7. OS X

 BLOG

 DOCS

 FAQ

 RSS (?)





Sequence expressions in wget and curl #
Given a range of JPGs to batch download:
http://example.com/manga/manga_06p01.jpg
http://example.com/manga/manga_06p02.jpg
...
http://example.com/manga/manga_06p99.jpg
one approach using wget would be:
$ wget http://example.com/manga/manga_06p{00..99}.jpg
Bash 4 is required for brace expansion using a range. Unfortunately, the expression fails to expand at all when read from a file (e.g., $ wget -i urls.txt).

curl, on the other hand, does not depend on Bash for sequencing:
$ curl -O http://example.com/manga/manga_06_p[00-99].jpg
so it will correctly parse sequences in a properly-formatted text file (e.g., urls.txt):
url = "http://example.com/manga/manga_06_p[00-99].jpg"
url = "http://example.com/manga/manga_07_p[00-99].jpg"
url = "http://example.com/manga/manga_08_p[00-99].jpg"
like so:
$ curl --remote-name-all -K urls.txt

/nix | Sep 12, 2011



Categories
/blosxom
/eink
/mac
/misc
/nix
/palm
/windows

Blosxom Archive
2012: 5 4 3 2 1
2011: 12 11 10 9 8 7 6 5 4 3 2 1
2010: 12 11 10 9 8 7 6 5 4 3 2 1
2009: 12 11 10 9 8 7 6 5 4 3 2 1
2008: 12 11 10 9 8 7 6 5 4 3 2 1
2007: 12 11 10 9 8 7 6 5 4 3 2 1
2006: 12 11 10 9 8 7 6 5 4 3 2 1
2005: 12 11 10

Blogger Archive
2005: 10 9 8 7 6 5 4 3 2 1
2004: 12 11 10 9 8 7 6 5 4 3 2 1
2003: 12 11 10 9 8 7 6

Ezine Archive
2004: 4 3 2 1
2003: 12 9 8 7 6 5 4 2 1
2002: 12 10 9 8 7 6 5 3 2 1
2001: 12 11 10