So, I'm finally doing some work.
[potpourri.git] / count_lines.sh
blob9b20bd2a85c178815d6c424bae9839d9855ee0ed
1 #!/bin/bash
3 # this is supposed to count lines
5 export CC=gcc
7 if [ ! -e "ncsl" ]
8 then
9 $CC ncsl.c -o ncsl
12 export TOTAL=0
13 for src_file in $(ls src)
16 if [[ ! $src_file =~ "~$" ]] && [[ $(file src/$src_file) =~ "ASCII C++" ]]
17 then
18 export TOTAL=$(bc <<< "$TOTAL + $(./ncsl -t -b src/$src_file)")
20 done
22 echo "Total number of lines of code :" $TOTAL