Created
September 23, 2014 12:25
-
-
Save JesseEisen/d57ae1681ba0c06018b2 to your computer and use it in GitHub Desktop.
my personal tool to count source file lines. This is Shell version
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/bash | |
# write to count the sourcefile | |
w=0 | |
par=$3 | |
origin=2 | |
echo "${par:=$origin}" | |
for s in $(find $1 -maxdepth ${par:=$origin} -type f -name "*.$2") | |
do | |
t=$(wc -l $s | awk '{print $1}') | |
echo -e "$s: \e[1;32m $t \e[0m" | |
let "w=w+t" | |
done | |
echo -e "\e[1;31m total:\e[1;32m $w \e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment