Skip to content

Instantly share code, notes, and snippets.

@asmedrano
Last active December 11, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asmedrano/4627261 to your computer and use it in GitHub Desktop.
Save asmedrano/4627261 to your computer and use it in GitHub Desktop.
Simple script to download a list of files with wget
Give a list like so...
Lets call it list.txt
jquery|http://code.jquery.com/jquery-1.8.3.min.js
modernizr|http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js
pydocs|http://docs.python.org/2/archives/python-2.7.3-docs-html.zip
djangodocs|https://www.djangoproject.com/m/docs/django-docs-1.4-en.zip
leaflet|http://cdn.leafletjs.com/leaflet-0.5/leaflet.js
leafletdocs|http://leafletjs.com/reference.html
d3|http://d3js.org/d3.v3.min.js
This bash script will download it for you in and put it in a folder called downloads
#!/bin/bash
OIFS=$IFS
IFS='|'
while read line;
do
set $line
mkdir -p downloads/$1
wget -P downloads/$1 $2
done < list.txt
IFS=$OIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment