More animation work
[potpourri.git] / count_lines_cheap.sh
blob33b44fc881e1edf304414260c71f8e4649e0f6e2
1 #!/bin/bash
3 # this is supposed to count lines, cheaply though
5 export TOTAL=0
6 for src_file in $(find src > t ; find include >> t ; cat t ; rm t)
7 do
9 if [[ ! $src_file =~ "~$" ]] && [[ $(file $src_file) =~ "ASCII C++" ]]
10 then
11 TEMP=$(wc -l "$src_file" | sed -e "s/\([0-9]*\).*/\1/g")
12 export TOTAL=$(bc <<< "$TOTAL + $TEMP")
14 done
16 echo "Total number of lines of code :" $TOTAL