Added running subtotal to do_process.sh

This commit is contained in:
Trey Blancher 2020-09-16 17:48:58 -04:00
parent c32204ebab
commit 5bc7c4af89
1 changed files with 3 additions and 0 deletions

View File

@ -54,9 +54,12 @@ if [[ -f ${DATE} ]]; then
echo echo
echo echo
WHOLE="" WHOLE=""
subtotal=0
for pattern in "${KEYS[@]}"; do for pattern in "${KEYS[@]}"; do
#echo "pattern=${pattern}" >&2 #echo "pattern=${pattern}" >&2
$grep -- "\[${pattern}\]" ${DATE} | timetracker $grep -- "\[${pattern}\]" ${DATE} | timetracker
subtotal=$(bc <<< "scale=2; ${subtotal} + $($grep -- "\[${pattern}\]" ${DATE} | timetracker | $grep "Section" | $grep -Po '\d+\.\d+hrs' | tr -d '[hrs]')")
printf "Subtotal: %3.2fhrs\n" ${subtotal}
echo echo
if [[ "${WHOLE}x" == "x" ]]; then if [[ "${WHOLE}x" == "x" ]]; then
WHOLE="${pattern}" WHOLE="${pattern}"