I want to execute a program periodically and watch when something changes. It sounds like watch would be the right command for that but it prints out annoying empty lines which makes it impossible to see the history. The -t switch does not really help here.
What i want:
user@machine ~$ #some previous command
user@machine ~$ watch -t date -Is
2020-10-09T12:50:13
2020-10-09T12:50:15
2020-10-09T12:50:17
What i get:
2020-10-09T12:50:17
(all the previous lines are gone).
I know i can use a while loop with a sleep command, but this takes longer to type and has other disadvantages. This loop: while true; do date -Is ; sleep 2; done works but i would prefer a simple command. I also read about a trick using tee, like this watch -t ' date -Is | tee -a ./somefile, but that is not always a viable solution for me since this only works with a writable filesystem and if it is a tempfs i can not read it after a reboot, which is a problem on a embedded system where i sometimes have no writable file system mounted and i can't read a tempfs after a crash/reboot.
I also tried to filter out empty lines with grep: watch -t date -Is | grep -v '^$' but then i have no output.

watch?watchuses ncurses-type terminal codes to rewrite the outputs. The output characters are disjoint, TERM-dependent, not arranged in lines, and not stored anywhere.watchalso breaks your terminal settings occasionally, requiring areset.