#!/bin/sh
sum0=0
sum1=0
sum2=0
wordlist=`cat test.txt`
for word in $wordlist
do
case $word in
[0-9]*)
sum0=`expr $sum0 + 1`
;;
[a-z]*)
sum1=`expr $sum1 + 1`
;;
[A-Z]*)
sum2=`expr $sum2 + 1`
;;
*)
;;
esac
done
echo sum0=$sum0
echo sum1=$sum1
echo sum2=$sum2
阅读(1043) | 评论(0) | 转发(0) |