hi
i'm trying to do program that counts the total no of words from files from a directory and all it's subdirectories.ang i get the binary operator expected error at line 7 and line 12.can you please help me with this as quick as possible?
if test -d $1
then
sum=0
for name in $1/*
do
if test -f $name
then
cuv=$(wc -w $name | awk '{print$1}')
sum=$(($sum + $cuv))
fi
if test -d $name
then
./dir.sh $name
fi
done
echo $sum
else
echo $1 is not a directory
fi