Spinning bar status while doing something.

After some googling, I came across this script to create a spinning cursor:

#!/bin/bash

# paste following in your script
declare -a Spinner

Spinner=(/ - \\ \| / - \\ \| )
Spinnerpos=0

update_spinner()
{
    printf "\b"${Spinner[$Spinnerpos]}
    (( Spinnerpos=(Spinnerpos +1)%8 ))
}

# testing :

printf "Spinner :  "

update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner

I'd like to be able to make use of a spinning cursor in one of my scripts while the script does it's work (ssh to another server, maybe unzip and copy some files, etc.)

Any idea how to do this? I'll probably be using ksh instead of bash, but I think think that will make that big of a difference.

If anyone know of a way to make a faster spinning cursor, I'd like that as well.

Thanks in advance,

If you are using ksh93, you could use the undocumented alarm function to asynchronously update a progress bar or a spinner. Milliseconds are supported.

See KSH93 Alarm Built-in for more information.

Unfortunately, we're using ksh88. Any suggestions on what to do here?