grep and context and all that

Terry tcjones at watdragon.waterloo.edu
Mon Jun 6 16:45:13 AEST 1988


I once considered adding a new yukko context option to grep.  If grep
were invoked with the new (say) -n# flag it would fork. The parent
would arrange to read the input (from named files if necessary),
remembering the last # lines, write lines to the child who execs a
brand new grep (or calls main() again :-)) with all the original
options, excluding the -n# and any filenames (which the parent will be
reading). The parent reads what the child grep has to say and outputs the
appropriate context etc.

It's not the nicest, but it would work.
-- 
"Waterloo -  I was defeated, you won the war,
 Waterloo -  promised to love you for evermore.
 Waterloo -  couldn't escape if I wanted to.
 Waterloo -  knowing my fate is to be with you."        ABBA.



More information about the Comp.unix.wizards mailing list