Created
January 17, 2012 12:59
-
-
Save informationsea/1626548 to your computer and use it in GitHub Desktop.
Count lines of files in the directory.
This file contains 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
function countlines() { | |
local basedir=$1 | |
local currentlines='0' | |
local thislines | |
shift 1 | |
while [ $1 ] ;do | |
thislines=`find "$basedir" -type f -name "*.$1" -print0 | xargs -0 cat | wc -l` | |
currentlines=$(($thislines + $currentlines)) | |
shift 1 | |
done | |
echo $currentlines | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment