On Fri, May 11, 2001 at 11:41:20AM +0200, Philip Newton wrote:
> Dominic Mitchell wrote:
> > assuming you can get into a bourne shell, you can
> > still do things like write cat(1) in sh, as well.
> 
> This is not going to help you pause output.
> 
> > Although it'd be hard to control without ^S and ^Q,
> 
> ...which was what the original post was all about.

No, you'd need the maths operators that came with later shells, so you
could work out lines.  Dammit, I'm going to have to write shmore now.

    #!/bin/sh
    lineno=1
    while read line
    do
        echo "$line"
        lineno=$((lineno+1))
        if [ $(($lineno % 24)) = 0 ] ; then
            echo -n " -- more -- "
            read ans </dev/tty
            test $ans = "q" && exit 0
        fi
    done

-Dom

Reply via email to