/*  --- Copyright University of Sussex 1992. All rights reserved. ----------
 >  File:           C.unix/lib/auto/grep.p
 >  Purpose:        search a set of files for a string
 >  Author:         Unknown, ??? (see revisions)
 >  Documentation:
 >  Related Files:
 */
compile_mode :pop11 +strict;

section;

define global vars macro grep;
lvars x char;
	0 -> x;
	until (nextchar(itemread) ->> char) == termin or char == `\n` do
		char; x + 1 -> x
	enduntil;
	consstring(x) -> x;
	pr(newline);    ;;; in case used in VED.
	sysobeylist([% 'grep ' >< x%])
enddefine;

endsection;

/*  --- Revision History ---------------------------------------------------
--- Mark Rubinstein, Aug  5 1985 - sectioned, lvarsed and made to work on UNIX
 */
