Skip to content

Instantly share code, notes, and snippets.

@jamesmartin
Forked from garybernhardt/gist:326045
Created March 9, 2010 06:00
Show Gist options
  • Save jamesmartin/326281 to your computer and use it in GitHub Desktop.
Save jamesmartin/326281 to your computer and use it in GitHub Desktop.
ls _posts/* | grep -c -E '[0-9]{4}-[0-9]{2}-[0-9]{2}' | while read fn; do day=`grep '#postdate\|#date' $fn | cut -d '-' -f 3 | cut -d ' ' -f 1`; git mv $fn `echo $fn | sed -E "s/-\([0-9]{2}\)-/-\1-$day-/"`; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment