((totalSum=0))
((iCount=0))
for fileName in `ls *.txt`
do
if [ ! -e "$fileName" ]
then
echo "$fileName is not exists"
continue
fi
strLineCount=$(wc -l ${fileName} | awk '{print $1}')
#strLineCount=$(cat $fileName | wc -l)
echo "$fileName [$strLineCount]"
((totalSum=totalSum+strLineCount))
done
echo $totalSum
((iCount=0))
for fileName in `ls *.txt`
do
if [ ! -e "$fileName" ]
then
echo "$fileName is not exists"
continue
fi
strLineCount=$(wc -l ${fileName} | awk '{print $1}')
#strLineCount=$(cat $fileName | wc -l)
echo "$fileName [$strLineCount]"
((totalSum=totalSum+strLineCount))
done
echo $totalSum