#!/bin/sh
# a wget wrapper to get these under a separate shell *and* progname

[ -n "$1" -a -n "$2" ] || exit 1

LANG=C \
wget -O "$1" --content-disposition --progress=bar:force:noscroll "$2" 2>&1 \
| stdbuf -i0 -o0 -e0 tr '>' '\n' \
| stdbuf -i0 -o0 -e0 sed -rn 's/^.*\<([0-9]+)%\[.*$/\1/p'
