On Fri, 11 May 2001, Dominic Mitchell wrote:
> 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

That breaks if the line is longer than the width of your screen.

MBM

-- 
Matthew Byng-Maddick      <[EMAIL PROTECTED]>     +44 20  8980 5714  (Home)
http://colondot.net/                             +44 7956 613942  (Mobile)
Under  any conditions,  anywhere,  whatever you  are doing,  there is some
ordinance under which you can be booked.  -- Robert D. Sprecht, Rand Corp.

Reply via email to