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?– entonioMay 15, 2022 at 13:37
-
Sure, just get a number of lines on the terminal -
tput lines
. And print that much lines before sleep. May 16, 2022 at 11:28 -