Compare commits

...

2 Commits

Author SHA1 Message Date
ida schmidt 9ab116d057 make pizza.sh clean up after itself 2023-04-26 01:29:40 -07:00
ida schmidt c184cd019a fix bc behavior 2023-04-26 01:28:44 -07:00
1 changed files with 8 additions and 1 deletions

View File

@ -26,7 +26,7 @@ while getopts ":hf:" option; do
done done
function panarea { function panarea {
AREA=$(echo "3.1415926535*($DIAM/2)^2" | bc) AREA=$(echo "3.1415926535*($DIAM/2)^2" | bc -l)
SIZE=$(echo $AREA*$FSI | bc) SIZE=$(echo $AREA*$FSI | bc)
calcratio calcratio
} }
@ -39,6 +39,13 @@ function calcratio {
grep 'ratios' -A 8 pizza.txt | sed /\\[*.\\]/d | cut -f 1 | sed $LABEL'!d' grep 'ratios' -A 8 pizza.txt | sed /\\[*.\\]/d | cut -f 1 | sed $LABEL'!d'
echo $RATIO*$SIZE | bc echo $RATIO*$SIZE | bc
done done
# cleanup
unset LABEL
unset RATIO
unset SIZE
unset FSI
unset AREA
unset DIAM
} }
case $1 in case $1 in