查看一天写了多少代码脚本

2019-06-03  本文已影响0人  呆木大人

先上结果

result.png

具体脚本

fileCount=0
lineCount=0

function checkFile() {
    file=$1
    if [ "${file##*.}"x = "m"x ]||[ "${file##*.}"x = "h"x ]
    then
        let fileCount=fileCount+1
        while read line
        do
            let lineCount=lineCount+1
        done < ${file}
#        echo ${lineCount}
    fi
}


for file in `find . -name "*.m" -o -name "*.h" `
do
    echo $file
    checkFile $file
done


echo ===================================
date
pwd
echo 总文件数: ${fileCount}
echo 总 行 数: ${lineCount}

上一篇 下一篇

猜你喜欢

热点阅读