Added running subtotal to do_process.sh
This commit is contained in:
parent
c32204ebab
commit
5bc7c4af89
|
@ -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}"
|
||||||
|
|
Loading…
Reference in New Issue