title: Show persistent status message on console
body: <p>I am working on a program that sends a lot of output to stdout, but I want to be able to easily tell what the program is doing. I've seen some programs show the output of a script or program, yet the last line on the console is "reserved", meaning the output from the commands are shown on the screen, but the last line (or two, or however many) are reserved for a static or occasionally changing status text (e.g. <code>Building &lt;xxxxxx&gt;...</code>). This way, one can see output from the script/program for debug/troubleshooting purposes, but also quickly glance over and see the status of the program. <strong>Is there any way to achieve this with a shell script?</strong> I don't mind using built-in system tools, such as <code>awk</code>, to format the text, as long as the tools used are commonly found on most systems. If possible, I'd also like to avoid <code>ncurses</code> and other libraries as well.</p>
  
  <p>If you still don't understand what I'm saying, I'll try to illustrate it here:</p>
  
  <pre>
  make -gcc -NOFLAGS -someotherGibberishHere Component1afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component2afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component3afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component4afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component5afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component6afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component7afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component8afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component9afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component10afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component11afdjadfjfadkladfjk
  
  .
  . (etc.)
  .
  
  ------------------------------------------------------------------------
  Installing component 11/134...
  </pre>
  
  <p>In this particular example, I'd like for the line "Installing component 11/134..." to remain there even once the console output starts to scroll. Preferably, I'd also like to keep that line right above it too.</p>
  
  <p>That way, once we get into the thick of the program and normally the shell would've started scrolling, we'd still see:</p>
  
  <pre>
  .
  . (more lines of output here)
  .
  make -gcc -NOFLAGS -someotherGibberishHere Component58afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component59afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component60afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component61afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component62afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component63afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component64afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component65afdjadfjfadkladfjk
  make -gcc -NOFLAGS -someotherGibberishHere Component66afdjadfjfadkladfjk
  ------------------------------------------------------------------------
  Installing component 66/134...
  </pre>