#!/bin/bash declare -i SUM=0 while read X ; do SUM+=$X done < calc.data echo "Sum is: $SUM"