-
Notifications
You must be signed in to change notification settings - Fork 16
/
srcCount
executable file
·24 lines (21 loc) · 1.25 KB
/
srcCount
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
javaCbl=$(grep --exclude-from=cobol/src-exclude-list --count ";" cobol/src/*.java | awk -F ":" '{tot = tot + $2} END {print tot}');
javaJcl=$(grep --exclude-from=jcl/src-exclude-list --count ";" jcl/src/*.java | awk -F ":" '{tot = tot + $2} END {print tot}');
antlrCics=$(grep --count ";" cics/src/*.g4 | awk -F ":" '{tot = tot + $2} END {print tot}');
antlrCbl=$(grep --count ";" cobol/src/*.g4 | awk -F ":" '{tot = tot + $2} END {print tot}');
antlrJcl=$(grep --count ";" jcl/src/*.g4 | awk -F ":" '{tot = tot + $2} END {print tot}');
antlrDb2=$(grep --count ";" db2z/src/*.g4 | awk -F ":" '{tot = tot + $2} END {print tot}');
antlrDli=$(grep --count ";" dli/src/*.g4 | awk -F ":" '{tot = tot + $2} END {print tot}');
javaTot=$((${javaCbl}+${javaJcl}));
antlrTot=$((${antlrCics}+${antlrCbl}+${antlrJcl}+${antlrDb2}+${antlrDli}));
grandTot=$((${javaTot}+${antlrTot}));
echo "java LOC cobol = ${javaCbl}"
echo "java LOC jcl = ${javaJcl}"
echo "antlr cics rules = ${antlrCics}"
echo "antlr cobol rules = ${antlrCbl}"
echo "antlr jcl rules = ${antlrJcl}"
echo "antlr db2z rules = ${antlrDb2}"
echo "antlr dli rules = ${antlrDli}"
echo "java LOC total = ${javaTot}"
echo "antlr rules total = ${antlrTot}"
echo "grand total FWIW = ${grandTot}"