/* Copyright (c) 1979 Regents of the University of California */
* cr3 - simulate chuck haley's cr3
* Bill Joy UCB July 1, 1977
* This filter simulates chuck haleys cr3,
* stopping output after each page (22 lines) to wait for
* a carriage return, sending 22 more lines, or a EOF, sending 10 more lines.
* Typing in a positive number will cause that many lines to be sent,
* a negative number that many lines to be skipped.
struct sgttyb otty
, ntty
;
int left
, nxtleft
, onintr();
if ((f
=fopen(argv
[0], "r")) == NULL
) {
nxtleft
= i
== 0 ? 11 : i
;
while (read(2, &ch
, 1) == 1) {
if (ch
< '0' || ch
> '9')