Skip to content

Instantly share code, notes, and snippets.

@garybernhardt
Created October 1, 2012 06:23
Show Gist options
  • Save garybernhardt/3809799 to your computer and use it in GitHub Desktop.
Save garybernhardt/3809799 to your computer and use it in GitHub Desktop.
(set -e && ls content/*.markdown | while read p; do DATE=$(echo $p | cut -d '/' -f 2 | cut -d '-' -f 1-3); TARGET=$(echo $p | sed 's/-/\//' | sed 's/-/\//' | sed -E 's/[0-9]+-//' | perl -pe 's/^(.*\/.*\/.*\/)(.)(.*)$/\1\u\2\3/' | sed -E 's/-|_/ /g'); echo $TARGET; mkdir -p $(dirname $TARGET); echo "<\!-- $DATE -->" > $TARGET; cat $p >> $TARGET; rm $p; done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment