I'm working on bash script that outputs some information every few seconds. Each new output should overwrite the last one (clear the terminal), and when I abort the script no output should be visible when I scroll back in the terminal. Pretty similar to 'watch' (which I cant use here for other reasons).
If I use 'clear', the screen gets cleared but all output is visible when I scroll back in the terminal. 'reset' deletes the entire scrollback, which is also not what I want. Using ANSI sequences like 'printf "\033[2J"' has the same effect as 'clear'.
Any help appreciated! cheers