Last active
October 13, 2015 16:17
-
-
Save picasso250/4222029 to your computer and use it in GitHub Desktop.
count how many lines you write in your project dir
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
#!/bin/sh | |
if [ x"$1" = x ] | |
then | |
code_dir="." | |
else | |
code_dir="$1" | |
fi | |
if [ x"$2" = x ] | |
then | |
exts="php js" | |
else | |
exts="$2" | |
fi | |
for ext in $exts | |
do | |
echo "$ext files" | |
printf "count: " | |
find $code_dir -type f -name "*.$ext" | wc -l | |
printf "lines: " | |
find $code_dir -type f -name "*.$ext" | xargs wc -l | tail -n 1 | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment