It is currently Sat, 04 Dec 2021 20:07:16 GMT



 
Author Message
 need a wait indicator
Hello experts,

I have been trying to find a little program or script that will show a
little rotating indicator. This is so that the user will know the script is
doing something rather than just looking at a flashing cursor. One of my
colleagues told me that unix already has one in there that goes like this |
/ - \ ....

any ideas

Thanks
Abid



 Tue, 22 Jul 2003 04:32:05 GMT   
 need a wait indicator
In article <95ch86$u...@coset.qualcomm.com>,
  "Abid Jindani" <ab...@usa.net> wrote:
Abid,

When I want to show a user something is happening in a shell script, I
call a little function like dots5

dots5 ()
{
sleep=/usr/bin/sleep
while :; do
        ${sleep} 1
        echo ".\c"
done &

PID=$!
          sleep 5
[ -n "$PID" ] && kill $PID >/dev/null 2>&1
echo ""

which prints 5"."'s across the screen before exiting. Of course, you
can extend the time easily or make the echo statement more involved if
you like.

Good Luck,
Mike

Sent via Deja.com
http://www.deja.com/



 Tue, 22 Jul 2003 07:58:05 GMT   
 need a wait indicator

you mean something like that? there is another thread (howto make a
statusbar in bash) with another solution. for sleep 10 put your command, ie
make bzImage>/dev/null or something else.

#!/bin/sh
function progress()
{
renice 20 $$ > /dev/null
DELAY=1
while true; do
  echo -en '|\r'
  sleep $DELAY
  echo -en '/\r'
  sleep $DELAY
  echo -en '-\r'
  sleep $DELAY
  echo -en '\\\r'
  sleep $DELAY
done
progress & sleep 10 ; kill $!

dont blame me for my poor english

karsten

--
Home   : http://www.nethunter2000.de | Es kann mich niemand daran hindern
Projekt: http://www.newbie-net.de    | ber  Nacht  klger   zu   werden.
Projekt: http://www.newbierouter.de  |                        K. Adenauer
Mailingliste, Forum, Newsserver, Anleitungen, Antworten -? Newbie-Net :o)



 Tue, 22 Jul 2003 07:18:19 GMT   
 
   [ 3 post ] 

Similar Threads

1. first X impressions: no hourglass wait indicators

2. fork,exec and wait and wait and wait and wait

3. Talk waits and waits for invitation (2nd)

4. Talk waits and waits for invitation

5. --wait and --random-wait ?

6. wait. wait pid

7. wait or not to wait, that is my question

8. after type the password need to wait a long time when telnet solaris

9. Need help with fork/exec/wait

10. HELP: Need function to wait ~1/10 s


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software