### getR4D.sh ### bash getR4D.sh ### must be a text file containing ### rainfall as recorded by TestRainGuage04.py ### prints the number of mm of rain that fell daDayRainTotal=0 while read -r line do daEpochTime=$(echo $line | sed -e "s/,.*$//") date=$(date -d @$daEpochTime | sed -e "s/\ *SAST.*$//") daHour=$(date -d @$daEpochTime | sed -e "s/^.*202..//" | sed -e "s/:.*$//") daRain=$(echo $line | sed -e "s/^.*,\ //") temp=$(expr $daRain+$daDayRainTotal | bc) daDayRainTotal=$temp done < $1 echo $daDayRainTotal