forked from EDmodel/ED2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cnt_lines.sh
executable file
·32 lines (31 loc) · 946 Bytes
/
cnt_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
#!/bin/bash
models="ED BRAMS Ramspost RAPP"
for model in ${models}
do
echo "========================================================================="
echo " + Model ${model}: "
echo " "
modellines=0
direcs=`ls -1 ${model}/src`
for dir in ${direcs}
do
if [ ${dir} != "test_cases" ] && [ ${dir} != "doc" ] && [ ${dir} != "preproc" ] && [ ${dir} != "post" ]
then
echo -n " - Directory ${dir}: "
files=`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}
fi
done
echo " - Total: ${modellines}"
echo "========================================================================="
echo " "
echo " "
echo " "
done