Shell Script to Count of five character words
Program
W.A.S.S. to count of five character words.
#07MCG20
cnt=0
for w in `cat good.sh`
do
len=`echo $w | wc -c`
len=`expr $len - 1`
if test $len -eq 5
then
cnt=`expr $cnt + 1`
fi
done
echo "Total words of length file are : $cnt"
Output
Total words of length file are : 3