How would I go about creating a "spinner". A spinner is that little progress indicater thingy that you sometimes see while a program is running.
-\|/- <-- characters used for a spinner, but how would I make it work. Thanks for any help.
This won't be the first time I've missed something obvious but ... I like the idea of showing a 'spinner' (I usually just output a dot after every few seconds or so many iterations of a loop) but ... how do you make use of it?
The only ways I can think of running one in a working script is to refresh the character after each iteration of a loop - which won't look very good if the loop takes a long time to run, or to run the process doing the work in the background while the spinner is displaying, which will work but introduces other messy problems (like checking for the first process ending).
I think what I was wondering was: is there any way to run processes in parallel in a shell script? (other than by running one process in the background)
Otherwise the spinner will just be displaying while nothing else is happening or (if it displays in a loop) it is likely to be 'turning' so slowly it won't look very effective anyway.
Hmmm so you want to start a process that spawns another process that updates the screen independantely from the main process. I think it would mean splitting the screen into two areas. I've seen something like this before.I'll have a look around. --
| Mike Nixon
| Unix Admin
|
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.