Using cURL to retrieve multiple URLs from a text file

curl -K params.txt

params.txt contents:

url = http://tomholland.me.uk/about
url = http://tomholland.me.uk/publications
output = file1.html
output = file2.html

Will create files named:

file1.html
file2.html

curl -K params.txt

params.txt contents:

url = http://tomholland.me.uk/{about}
url = http://tomholland.me.uk/{publications}
output = #1.html
output = #1.html

Will create files named:

about.html
publications.html

Update:

An alternative to the second method:

xargs -n1 curl -o "#1.html" < urls.txt

urls.txt contents:

http://tomholland.me.uk/{about}
http://tomholland.me.uk/{publications}

Will create files named:

about.html
publications.html

If you're running Tiger (Mac OS 10.4) or Leopard (Mac OS 10.5) then curl and xargs are there by default (I'm unsure about Jaguar or Panther).

Tagged , and .

Most used blog post tags

Blog entries by month

  1. January 2012 (1)
  2. August 2011 (2)
  3. March 2011 (1)
  4. February 2011 (1)
  5. November 2010 (1)
  6. October 2010 (1)
  7. August 2010 (2)
  8. January 2009 (1)
  9. December 2008 (1)
  10. November 2008 (1)
  11. October 2008 (2)
  12. September 2008 (3)