#!/bin/bash
SUM=0
while read f; do
TEMP1="$(echo ${f//[a-z]})"
TEMP2="${TEMP1:0:1}${TEMP1:0-1}"
for i in $TEMP2; do
echo $SUM + $i
SUM=$(( $SUM + $i ))
done
done < "$1"
echo $SUM