Tente:
function prog {
typeset w=80 p="$1" pt= IFS=" "
typeset pc="$((p * w / 100))"
shift
while ((pc)); do pt=$pt.; ((pc-=1)); done
printf "\r[K|%-${w}s| %3d%% %s" "$pt" "$p" "$*"
}
# test loop
x=1; while ((x <= 100)); do
prog "$x" traitement en cours...
sleep 1 # do some work here
((x+=1))
done
echo