Shell Script - comparing lines of text, deleting matches

Posted by SirRatty on Stack Overflow See other posts from Stack Overflow or by SirRatty
Published on 2010-04-23T03:53:16Z Indexed on 2010/04/23 4:03 UTC
Read the original article Hit count: 279

Filed under:
|
|
|
|

Hi all, I've done some searching for this but cannot find what I'm after, specifically.

I have two files: "a.txt", "b.txt".

Each contains a list of email addresses, separated by newlines.

For all lines in "a.txt", I need to check for a match anywhere in "b.txt". If so, the email address in "a.txt" needs to be removed.

(Alternatively, a new file "c.txt" could be created with the output if that is easier.)

I'm using Mac OS X, so am looking for a shell script that could help, or pointers to how I'd go about constructing the script. Thanks for any help.

© Stack Overflow or respective owner

Related posts about shell

Related posts about script