how can i create a simple progress bar in shell

please help me as i want to create a simple process bar to check the status for any script.........
especially in UNIX

Check http://www.unix.com/shell-programming-scripting/26542-shell-script-animation.html

i have already checked them they are not working...........
i need a working one..

#!/bin/sh
i=50
echo "0--------20--------40-------60--------80-------100%"
while [ $i -ge 0 ]
do
echo "#\c"
sleep 1
i=`expr $i - 1`
done

but can i get the script log/output and this progress bar on the same screen
as my scripts has various steps and function and i wanted to see the o/p also n this progress bar also

cummon guys please help:(

Though not a shell script, but can be of interest:

Theiling Online: ASCII bar

HTH