Created
April 19, 2012 02:04
-
-
Save tzengyuxio/2417859 to your computer and use it in GitHub Desktop.
stats of octopress blogpost
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 | |
# start year and end year | |
SYEAR=2005 | |
EYEAR=`date "+%Y"` | |
POSTPATH=~/github/octopress/source/_posts/ | |
echo | |
echo "YEAR File # Word Count" | |
echo "==============================" | |
for (( i=$SYEAR; i<=$EYEAR; i=i+1 )) | |
do | |
NUMFILES=`ls -l $POSTPATH$i* 2> /dev/null | wc -l` | |
NUMWORDS=" 0" | |
test $NUMFILES != "0" && NUMWORDS=`wc -m $POSTPATH$i-* | tail -n 1 | sed 's/ total//'` | |
echo "$i $NUMFILES $NUMWORDS" | |
done | |
echo "==============================" | |
NUMFILES=`ls -1 $POSTPATH* | wc -l` | |
NUMWORDS=`wc -m $POSTPATH* | tail -n 1 | sed 's/ total//'` | |
echo "Total $NUMFILES $NUMWORDS" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment