add Chinsese character count script

pull/77/head
Jimmy Song 2017-11-21 23:14:05 +08:00
parent 20d477d3df
commit f12c0f9442
1 changed files with 13 additions and 0 deletions

13
tools/wordcount.sh 100755
View File

@ -0,0 +1,13 @@
#!/bin/bash
# Count Chinese characters
total=0
basedir="../"
for x in `cd $basedir;fd -e md`
do
i=`cnwordcount -f $basedir/$x|cut -d " " -f2`
total=$(($total+$i))
if [ $i -ne 0 ]; then
echo "$x $i"
fi
done
echo "Total $total"