2 pulses_per_liter
='4380'
9 totals
="$accounts/.totals"
11 tmp
="/tmp/beertmp-$$";
12 dialog
=$
(which dialog
);
14 rst
() { echo -ne "\033[0;0H"; }
17 precise
="$(echo 'scale=10; '"$@
" | bc)"
18 echo 'scale=2; '"$precise/1" |
bc
23 litres
=$
(calc
"$pulses/$pulses_per_liter")
24 beers
=$
(calc
"($pulses/$pulses_per_liter)/$beer_liters")
25 price
=$
(calc
"(($pulses/$pulses_per_liter)/$beer_liters)*$beer_price")
26 echo $beers beers
'('$price $currency, $litres l
, $pulses pulses
')'
30 echo $
(wc -c "$accounts/$1" | cut
-d ' ' -f 1)
34 beer_calc
"$(beer_pulses "$1")"
38 "$dialog" --inputbox "New account name" 0 0 2>"$tmp"
39 [ $?
= 0 ] && touch "$accounts/$(cat "$tmp")";
43 $dialog --menu "$title servis" 0 0 0 new
"Novy stamgast" exit "Konec party" 2>"$tmp"
44 option
="$(cat "$tmp")"
52 echo "=== Totals ($totals) ==="
63 ls -1 --group-directories-first "$accounts" |
while read i
; do
64 echo -n "$i"; echo -ne "\x00";
65 echo -n $
(beer_stat
"$i"); echo -ne "\x00"
66 echo -e "$i\t$(beer_stat "$i")" >> "$totals"
67 done |
xargs -0 $dialog --menu "$title stamgasti" 0 0 0
73 pulses_start
=$
(beer_pulses
"$stamgast")
76 pulses_current
=$
(beer_pulses
"$stamgast")
77 pulses_diff
=$
[ $pulses_current - $pulses_start ]
80 echo == Cepuje stamgast
$stamgast, ukonci ctrl
+c
==
81 echo "CURRE: $(beer_calc $pulses_diff) ";
82 echo "TOTAL: $(beer_calc $pulses_current) ";
85 "$backend" |
tee -a "$accounts/$stamgast" >/dev
/null
This page took 0.292113 seconds and 5 git commands to generate.