#!/bin/bash w=0 for s in $( find . -name *.[hc] ) do t=$( wc -l $s | awk '{print $1}' ) let "w=w+t" done echo $w