Last active
August 29, 2015 14:10
-
-
Save andersonvom/c272dd40ac5dcf8b96de to your computer and use it in GitHub Desktop.
Gather number of executive orders by president, by year
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
temp_dir=$(mktemp -d /tmp/orders.XXXX) | |
pushd $temp_dir | |
for year in $(seq 1994 2014) 2001-clinton 2001-wbush 2009-wbush 2009-obama | |
do | |
echo Downloading $year | |
wget -q "http://www.archives.gov/federal-register/executive-orders/$year.html" | |
done | |
grep * -e 'Signed:' | # get dates \ | |
egrep -ve ' <' | # filter out empty dates \ | |
sed -e 's/:.*, */ /' -e 's/<.*//' | # filter out all but filenames and years\ | |
sort | # duh \ | |
uniq -c # count per year | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment