- #History
- after=$(( $date - $lastdate))
- test $historymax -gt 0 && {
- history=$(echo -n "$(yes | tr '\ny' $laststate | head -c $after)$history" | head -c $historymax)
- for len in $historylen; do
- on="$(echo -n ${history::$len} | tr -d 0 | wc -c)"
- on="$(echo "scale=2; $on/$len" | bc)"
- printf " %.2f" "$on"
- done
- }
-