I have a bash command that I want to run once a second and keep the output showing on the screen. I could do something like the following:
while "true"; do foo; sleep 1; done
but this creates distracting scrolling. Alternatively, I could do the following:
while "true"; do clear; foo; sleep 1; done
but this causes the output to flash as it is cleared and written. Is there a good way to just have the output of the command overwrite what is on the terminal?