Hi, Gentoo! I've finally been pushed over the edge. I simply can't stand it any longer. The "it" in this case is viewing a file or process output and either: (a) using less, and have it take just 10 screen lines; (b) using cat etc., and have the interesting part scroll away.
To solve this dilemma, I've written dog, a short script that will splat lines to the screen if they're few enough, invoke less otherwise. I've set the threshold between the two cases at 60 lines. If your screen is a different size, change the two obvious bits. Enjoy! dog: ######################################################################### #!/bin/bash export IFS="" lin=0 while [ $lin -lt 60 ] && read ; do buf[$lin]=$REPLY lin=$((lin + 1)) done if [ $lin -ge 60 ] ; then ( for (( i = 0 ; i < 60 ; i++ )) ; do echo ${buf[$i]} done while read ; do echo $REPLY done ) | less else for (( i = 0 ; i < $lin ; i++ )) ; do echo ${buf[$i]} done fi ######################################################################### -- Alan Mackenzie (Nuremberg, Germany).