Skip to content

Instantly share code, notes, and snippets.

@andersonvom
Last active August 29, 2015 14:10
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 andersonvom/c272dd40ac5dcf8b96de to your computer and use it in GitHub Desktop.
Save andersonvom/c272dd40ac5dcf8b96de to your computer and use it in GitHub Desktop.
Gather number of executive orders by president, by year
#!/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