When using more or less, the output is paused at the end of each page. Is there some way to have it pause only for a few seconds (configurable or not), and then continue to the next page? Is there some other tool that can do it?
1 Answer
I remember playing with something like that in the MS-DOS age. Cute, but very unpractical.
But just as an exercise in strange things:
#!/bin/bash while read do echo "$REPLY" sleep 1s done Save it as 'scroll' and use scroll < textfile
If you want to do a page-by-page scroll, you can use tput to determine how many rows there is in a terminal.
#!/bin/bash while read do lines=`tput lines` while [ $lines -gt 0 ] do echo "$REPLY" read lines=$(( $lines - 1 )) done sleep 1s done - Would there be a way to sleep only after filling the terminal's height?entonio– entonio2022-05-15 13:37:35 +00:00Commented May 15, 2022 at 13:37
- Sure, just get a number of lines on the terminal -
tput lines. And print that much lines before sleep.White Owl– White Owl2022-05-16 11:28:22 +00:00Commented May 16, 2022 at 11:28 - Would you edit your answer with
tputso I could accept it? :)entonio– entonio2022-05-24 22:40:29 +00:00Commented May 24, 2022 at 22:40