[Novalug] how to output parts of files that are common
novalugml at jgcomp.com
Wed May 13 14:34:32 EDT 2009
On Wed, May 13, 2009 at 08:19:55AM -0400, Raul Parra wrote:
> Jon is right - I just tested comm on two files and messed with the order and
> spacing but left the exact same lines in place and comm did not correctly
> find the strings that were unique and common between the files.
> On Tue, May 12, 2009 at 5:02 PM, Jon LaBadie <novalugml at jgcomp.com> wrote:
> > On Tue, May 12, 2009 at 03:44:15PM -0400, Bob Copeland wrote:
> > > On Sun, May 10, 2009 at 11:05 AM, Nino Pereira <pereira at speakeasy.net>
> > wrote:
> > > > I think I know how to do the reverse, viz., find the parts of
> > > > the files that differ (with diff or xxdiff). But, how do you get
> > > > only the sections of files that are equal?
> > >
> > > In case you haven't found it yet -- the opposite of diff is comm(1)!
> > Not really similar commands. comm expects things in an ordered sequence
> > and extra lines can throw its matching off.
> > jl
> > --
I wonder if you could take the diff output and write a script to use
the line numbers and generate the inverse?
Jon H. LaBadie jon at jgcomp.com
12027 Creekbend Drive (703) 787-0884
Reston, VA 20194 (703) 787-0922 (fax)
More information about the Novalug