-
Notifications
You must be signed in to change notification settings - Fork 7
/
count.sh
executable file
·35 lines (32 loc) · 765 Bytes
/
count.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
#!/bin/bash
# Terminal ANSI Color codes
NONE='\033[00m'
RED='\033[00;31m'
GREEN='\033[00;32m'
YELLOW='\033[00;33m'
PURPLE='\033[00;35m'
CYAN='\033[00;36m'
WHITE='\033[00;37m'
BOLD='\033[1m'
UNDERLINE='\033[4m'
LINE="--------------------------------------------------------------------------"
COUNT=0;
echo $LINE
echo "[# LINES] => [FILE]"
echo $LINE
for f in $(find . -name '*.cpp' -o \
-name '*.CPP' -o \
-name '*.c' -o \
-name '*.C' -o \
-name '*.h' -o \
-name '*.H' -o \
-name '*.hpp' -o \
-name '*.HPP' -o \
-path "./src/lib/layer1_foundations/Eigen_interface/Eigen" -prune -false); do
tmp=$(wc -l < $f);
echo "$tmp => $f";
COUNT=$[COUNT+tmp];
done
echo $LINE
echo -e "${GREEN}Total number of lines of code is $COUNT${NONE}"
echo $LINE