forked from rgknox/ED2
-
Notifications
You must be signed in to change notification settings - Fork 4
/
count_lines.sh
executable file
·36 lines (35 loc) · 950 Bytes
/
count_lines.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
models="ED BRAMS Ramspost"
for model in ${models}
do
echo "========================================================================="
echo " + Model ${model}: "
echo " "
modellines=0
direcs=$(ls -1 ${model}/src)
for dir in ${direcs}
do
case "${dir}" in
test_cases|doc|preproc)
echo "Skip" >> /dev/null
;;
*)
echo -n " - Directory ${dir}: "
files=$(/bin/ls -1 ${model}/src/${dir})
dirlines=0
for file in ${files}
do
nlines=$(sed '/^ *$/ d' ${model}/src/${dir}/${file} | wc -l)
let dirlines=${dirlines}+${nlines}
done
echo "${dirlines} lines"
let modellines=${modellines}+${dirlines}
;;
esac
done
echo " - Total: ${modellines}"
echo "========================================================================="
echo " "
echo " "
echo " "
done