### getR4D.sh ### Computes the total rainfall reflected by the ### rain4DayTestData.csv file cp /dev/null R4D_tmp01.csv 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 < rain4Day.csv echo $daDayRainTotal