public
Last active

  • Download Gist
bash-is-fun.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/usr/bin/env bash
 
WD=`pwd`
tiger_em () {
directory=$WD/$1
shift
until [ -z "$1" ]
do
get_em $directory "ftp://ftp2.census.gov/geo/tiger/TIGER2010/"$1
shift
done
}
 
get_em () {
echo "Getting" $1 $2
wget -r -nH -c -nd -P $1 $2
unzip_em $1
}
 
unzip_em () {
cd $1
unzip -o "*.zip"
cd $WD
}
 
tiger_em "shapes/districts" "CD/108/tl_2010_us*" "CD/111/tl_2010_us*"
tiger_em "shapes/states" "STATE/2000/tl_2010_us*" "STATE/2010/tl_2010_us*"
tiger_em "shapes/counties" "COUNTY/2000/tl_2010_us*" "COUNTY/2010/tl_2010_us*"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.