-
-
Notifications
You must be signed in to change notification settings - Fork 150
/
uguide_results.sh
executable file
·47 lines (40 loc) · 1.55 KB
/
uguide_results.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# USAGE: ./uguide_results.sh
# ACTION: (1) check for existence of taxcalc package
# (2) executes several tc commands used in uguide.htmx
# (3) shows differences between uguide.out and uguide.res
# (4) prints reminder of how to create *.png files
# (5) delete non-HTML tc output files
echo "STARTING : `date`"
# check existence of taxcalc package
conda list taxcalc | awk '$1~/taxcalc/{rc=1}END{exit(rc)}'
if [[ $? -eq 0 ]]; then
echo "ERROR: taxcalc package does not exist"
exit 1
fi
# exectue tc commands used in uguide.htmx
OUT=./uguide.out
echo "uguide.res" > $OUT
tc cps.csv 2022 --reform ref3.json --tables
echo "$ cat cps-22-#-ref3-#-tab.text" >> $OUT
cat cps-22-#-ref3-#-tab.text >> $OUT
tc cps.csv 2024 --reform ref3.json --graphs
echo "create PNG graph output by hand" >> $OUT
tc cps.csv 2016 --sqldb
echo "$ cat tab.sql | sqlite3 cps-16-#-#-#.db" >> $OUT
cat tab.sql | sqlite3 cps-16-#-#-#.db >> $OUT
# show differences between uguide.out and uguide.res
echo "diff uguide.out uguide.res"
echo "*********************************************************************"
diff $OUT uguide.res
echo "*********************************************************************"
# remind how to convert graph *.html files to *.png files
echo "==> open cps-24-#-ref3-#-atr.html and save as atr.png"
echo "==> open cps-24-#-ref3-#-mtr.html and save as mtr.png"
echo "==> open cps-24-#-ref3-#-pch.html and save as pch.png"
# remove non-HTML tc output files
rm cps-??-#-*csv
rm cps-??-#-*text
rm cps-??-#-*db
echo "FINISHED : `date`"
exit 0