- echo -ne "$time\t$date $(date '+%F %T') $statenum"
-
- #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)"
- LC_ALL=C printf " %.2f" "$on"
- done
- }