kubernetes-handbook/tools/wordcount/wordcount.sh

14 lines
254 B
Bash
Raw Normal View History

2017-11-21 23:14:05 +08:00
#!/bin/bash
# Count Chinese characters
total=0
2017-11-30 19:11:22 +08:00
basedir="../../"
2017-11-21 23:14:05 +08:00
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"