Skip to content

Instantly share code, notes, and snippets.

@anotheremily
Created April 6, 2012 19:53
Show Gist options
  • Save anotheremily/2322494 to your computer and use it in GitHub Desktop.
Save anotheremily/2322494 to your computer and use it in GitHub Desktop.
recursive line count
#!/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