Some work...
[potpourri.git] / count_lines.sh
blobf6376fc13fbafefd62bd42c26bf60ae2cd958ca8
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 $(find source)
16 if [[ ! $src_file =~ "~$" ]] && [[ $(file $src_file) =~ "ASCII C++" ]]
17 then
18 export TOTAL=$(bc <<< "$TOTAL + $(./ncsl -t -b $src_file)")
20 done
22 echo "Total number of lines of code :" $TOTAL