grep replacement

Richard A. O'Keefe ok at quintus.uucp
Tue Jun 14 15:54:04 AEST 1988


In article <8080 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>Removing the ability to get context diffs when they are wanted WOULD
>be a bad idea.  Removing this feature from "diff" itself is not a
>bad idea; I hate for "diff" to do extra work every time I run it when
>I virtually never use the context feature.  Consider
>	diff a b | diffc a b
>where "diffc" reads the "diff" information in parallel with the two
>files "a" and "b" to produce the context-diff output.

About half of my calls to "diff" feed it with a pipe, e.g.
	NewProgramVersion <Data | diff ..Options.. - ExpectedOutput
I don't know how diff handles this, and I don't care; that's diff's job.
If you split it into two programs, someone who wants a context difference
for regression testing has to figure out how to handle pipes (him|her)self.
There is not the least fragment of a shadow of a reason for the -c option
to slow "diff" down in the cases when it is not used.  As one method of
implementation, consider a stripped down diff which exec()s another program
(/lib/diffc, perhaps) when it sees the -c option.

Berkeley may have gone overboard in adding new flags, but at least adding
new flags doesn't break working code.  If I have to rewrite scripts which
use only features documented in the V.2 SVID because someone decided that
his ideas of elegance were more important than my labour, I will be very
upset.



More information about the Comp.unix.wizards mailing list