[lug] parsing between two lists

Riggs, Rob RRiggs at doubleclick.net
Wed Mar 27 08:30:38 MST 2002


Unique in list A: diff -u listA listB | grep ^- | sed 's/^.//g'
Unique in list B: diff -u listA listB | grep ^+ | sed 's/^.//g'
Common to both: diff -u listA listB | grep "^ " | sed 's/^.//g'

-----Original Message-----
From: qqq1one @yahoo.com [mailto:qqq1one at yahoo.com]
Sent: Tuesday, March 26, 2002 10:34 PM
To: lug at lug.boulder.co.us
Subject: [lug] parsing between two lists


If, using "sdiff fileA fileB", I get a listing that looks like this:

    alien         alien
    allegro     | alsa-lib-devel
    alsaplayer  | Alsa-sound-mini-HOWTO
    alsa-utils    alsa-utils
    etc...

...but I would rather have a list that shows what's in fileA that's not
in fileB:

    allegro
    alsaplayer
    etc...

and another list that shows what's in fileB that's not in fileA:

    alsa-lib-devel
    Alsa-sound-mini-HOWTO
    etc...

and perhaps even another list that shows what is common between listA
and listB:

    alien
    alsa-utils
    etc...

is there a way to do this using sdiff?  Or perhaps a grep embedded in
some script?  Or is there yet another approach altogether that would
work better?

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
_______________________________________________
Web Page:  http://lug.boulder.co.us
Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list