Added test* and 2018-2020* to .gitignore. Converted chug.sh to zsh

This commit is contained in:
Trey Blancher 2020-12-18 17:50:36 -05:00
parent 5bc7c4af89
commit e4bd71e9ec
3 changed files with 9 additions and 17 deletions

5
.gitignore vendored
View File

@ -4,7 +4,12 @@
*.tar
*.pyc
*.sw*
test.*
work
timetracker.py-pre-incident-fixup
do_process.bak2017-11-06_file-test
2017*
2018*
2019*
2020*
2021*

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/zsh
PATH=/Users/tblancher/bin:/Users/tblancher/homebrew/opt/coreutils/libexec/gnubin:/usr/bin:/bin
[[ "${1}" == "-i" ]] && IGNORE_DO_PROCESS=1 && shift
@ -19,6 +19,9 @@ for date in $(date +%F -d "${DATE}") \
if [[ -f ${date}.log ]]; then
[[ -n $IGNORE_DO_PROCESS ]] || ./do_process.sh ${date}.log | less
daily_total=$(./do_process.sh ${date}.log | grep -P "Grand total:" | grep -Po "\d+\.\d+")
if [[ ${daily_total} -gt 24 ]]; then
daily_total=24.00
fi
else
daily_total=0
fi

16
test.sh
View File

@ -1,16 +0,0 @@
#!/bin/bash
ORGS=()
get_list_of_orgs () {
orgs=$( grep -Po "\s+\[.*\]" | tr -d '[][]' )
for org in ${orgs}; do
[[ "${ORGS[@]}" =~ "${org}" ]] || ORGS+=("${org}")
done
}
get_list_of_orgs < 2017-09-20.log
for (( i=0; i < ${#ORGS[@]}; i++)); do
echo ${ORGS[$i]}
done