Created
July 3, 2020 14:58
-
-
Save jsfan3/cb800fbf99bef7ae6ec6723046b6972c to your computer and use it in GitHub Desktop.
Conteggio codice
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 | |
DIR=~/Projects | |
cd $DIR | |
# Contare classi: | |
a=`find . -name \*.java -print | wc -l` | |
echo "" | |
echo "Number of Java classes: $a" | |
# Conteggio complessivo: | |
b=`find . -name \*.java -exec cat {} \; | wc -l` | |
echo "" | |
echo "Java lines: $b" | |
c=`find . -name \*.css -exec cat {} \; | wc -l` | |
echo "" | |
echo "CSS lines: $c" | |
d=`find . -name \*.json -exec cat {} \; | wc -l` | |
echo "" | |
echo "JSON lines: $d" | |
f=$((`find . -name \*.h -exec cat {} \; | wc -l` + `find . -name \*.m -exec cat {} \; | wc -l`)) | |
echo "" | |
echo "iOS Objective-C lines: $f" | |
g=`find . -name \*.js -exec cat {} \; | wc -l` | |
echo "" | |
echo "Javascript lines: $g" | |
echo "" | |
echo "Total lines of code: $((a + b + c + d + e + f + g))" | |
cd ~ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment