0

I have a process which I'm running in a terminal session. The process prints nothing (or perhaps it prints a lot of junk which I redirect somewhere), and takes quite a while, e.g. a couple of minutes.

Now, I want to wrap it somehow, so that while it's running, I'll get some sort of visual indication of it not being stuck. It could be a rotating bar (-->/->|->\->-), or some point which goes back-and-forth on the line, or at worst even just some printouts with newlines every once in a while.

Bonus points if this progress indicator becomes "stuck" if the process becomes stuck and its CPU usage drops to 0 etc.

4
  • What are the indications that your process becomes "stuck"? How can an external process know that? Jun 19 at 13:51
  • @glennjackman: An external process can't really know this, but it can make a guess by looking at the CPU usage and noticing when it drops to 0. But like I said, that's just icing on the cake.
    – einpoklum
    Jun 19 at 14:35
  • you could write a script that just generates the spinner. Launch it in the background before you invoke your long running program: spinner.sh & your_program Jun 20 at 12:25
  • @glennjackman: I know I can just "do it myself"; the question is whether there's some ready-made facility for this. I mean, lots of apps/utilities use spinners and progress bars, I was hoping this is available separately somehow.
    – einpoklum
    Jun 20 at 12:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.