Shell Script Animation

Hi,

I want to write a shell script which can do some animation

The animation is as follows

it is like a progress barwhich hould gone on inresing with time & at the end of the line there should be the progess

Eg

== - 10%
==== | 20%
============== / 40%

something like this
(the %age progress is at a constant place the html format is not showing it properly)
can someone help me with this ??

i=1
b=0
p=0
while [ $i -le 100 ]                                                                                                                                                             
do
   o=1
   while [ $b -ge 0 ]
   do
      echo "\b\c"
      (( b -= 1 ))
   done

   while [ $o -le i ]
   do
   echo "=\c"
   (( o += 1 ))
   done
   b=$(( o + 3 ))
   [ p -eq 3 ] && p=0
   [ p -eq 0 ] && CAR='|'
   [ p -eq 1 ] && CAR='/'
   [ p -eq 2 ] && CAR='\'
   (( p += 1 ))

   echo " ${CAR} $i%\c"
   sleep 1
   (( i += 1 ))
done

Cheers

try this link