题解 | #打印每一行出现的数字个数#
打印每一行出现的数字个数
http://www.nowcoder.com/practice/2d2a124f98054292aef71b453e705ca9
a=0
while read line;do
((a++))
b=$(echo $line|grep -o [1-5])
n=0
for i in $b;do
let n+=1
done
echo line$a number: $n
let sum+=$n
done< nowcoder.txt
echo sum is $sum