#!/bin/sh
# count lines of code that you ever have write
if [ $# -lt 1 ]; then
echo "Usage: $0 <directory>..."
exit 0
fi
for directory
do
lines=`find "$directory" -regextype posix-egrep -type f -a -regex '.*\.(c|cc|cpp|h)' -exec wc -l {} \; | gawk '{ sum += $1 }; END { print sum }'`
sum=$((sum+lines))
done
echo $sum
#count shell script
#-type f -a -executable
原来前些天得出的16万行代码包含了别人的项目,真正自己写的只有7万多。。。。
统计自己写了多少行代码
最新推荐文章于 2024-05-31 16:03:30 发布