grep replacement

Doug Gwyn gwyn at brl-smoke.ARPA
Mon Jun 13 09:02:35 AEST 1988


In article <3350 at phri.UUCP> roy at phri.UUCP (Roy Smith) writes:
>Unless I'm misunderstanding jad, he's talking about fixed length records.

She was.

The important point is that UNIX text (line-oriented) tools typically
break miserably when lines containing more than 256 or 512 (sometimes
more) characters are encountered.  In many cases this is not a
necessary feature but was due to quick-and-dirty implementation.
It IS more work to read in an arbitrarily long line, but once you
write your getline() function you could add it to the local library
and then it would be easy to do in the future.

I seem to recall that Lindemann fixed this problem in "sort" for SVR2.

>Also, I agree with whoever said that taking context diffs out of
>diff is a bad idea.

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.  By separating
the two functions, it is not only likely to speed up non-context use
of "diff" but also it is more likely to get the answer right, and it
is easier to work on improving "diffc".  (Existing context diff output
is sometimes pretty horrible, for example larger than the inputs.)



More information about the Comp.unix.wizards mailing list