svn path=/trunk/; revision=123
progress(){
tail --pid=$$ -f "$statusfile" \
| tr '\r' '\n' \
- | sed -urn 's;^.* ([0-9]{1,3})(,[0-9]+)?% *$;\1;p' \
+ | sed -urn '1~5s;^.* V: +([0-9]+)(\.[0-9]+) A-V:.*$;\1;p' \
+ | while read m; do
+ printf "%s\n" "$(($m * 100 / $length))"
+ done \
| while read n; do
- [ "$n" != "$previous" ] && printf "%s\n" "$((100 - $n))"
+ [ "$n" != "$previous" ] && printf "%s\n" "$n"
previous=$n
done
}
printf '<span class="progress"><span style="width: %s%%;">%s</span></span>\n' $n $n
done
-
-
-
# vi:set filetype=html: