15 lines
215 B
Bash
15 lines
215 B
Bash
|
#!/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 < input
|
||
|
|
||
|
echo $SUM
|