N automatically scrolling, time-delayed Unix pager command

lesspagerunix

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?

Best Answer

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

Related Question