Created
April 6, 2012 19:53
-
-
Save anotheremily/2322494 to your computer and use it in GitHub Desktop.
recursive line count
This file contains hidden or 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
#!/bin/bash | |
# searches for php files. change find command to change what it searches for. | |
function loc() { | |
tloc=0 | |
for f in `find . -iname '*.php'` | |
do | |
cloc=`wc -l ${f}` | |
tloc=$((${tloc} + `echo ${cloc} | cut -d' ' -f1`)) | |
echo ${cloc} | |
done | |
echo "Total:" ${tloc} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment