I'd like to view output of big commands slowed down, like a slideshow with e.g. automatic, 500ms delay between each scroll. What is the simplest way to achieve this?
Asked
Active
Viewed 2,659 times
3 Answers
9
A simple solution using bash:
function scroll
{
while read -r ; do echo "$REPLY" ; sleep ${1:-0.5} ; done
}
Usage
long_command | scroll [delay]
delay is optional and defaults to 0.5.
Exit with Ctrl+C
cYrus
- 22,335
4
If you can live with 1s resolution, you could do tail -n +0 -f -s <seconds>.
Nicole Hamilton
- 10,233
2
You could use vim with an appropriate mapping to achieve this:
vim -c 'map <S-f20> L:redraw<cr>:sleep 500m<cr><C-d><S-f20>' -c 'execute "normal \<S-f20>"' -
Ctrl-d scrolls half a page at a time, replace with 10j to scroll 10 lines at a time.
Thor
- 6,763
- 1
- 40
- 44