m.seaman at infracaninophile.co.uk
Fri Jan 9 07:48:37 PST 2004
On Fri, Jan 09, 2004 at 09:19:37AM -0600, Jack L. Stone wrote:
> Dear list:
> I hope think this is not off-topic, and is just about running a script in
> FBSD to delete specific lines in a flat file based on info in another flat
> My scripting skills are very limited and need help on how to purge my mail
> lists. We maintain several majordomo mail lists on a Tech magazine site
> (www.antennex.com) with 60,000 readers. Needless to say, it is real tedious
> to try and keep the lists up to date (groan).
> I have scripted a way to capture the bounces (by list) into a plain text
> file (1 address per line), but haven't figured out how to purge those from
> the lists. In other words, if the address is found in the bounce list, then
> delete from the main lists (also one address per line).
> I'd appreciate suggestions on how to do this.
comm(1) is what you need. Try:
% sort mailing-list > mailing-list.sorted
% sort bounce-addresses > bounce-addresses.sorted
% comm -23 mailing-list.sorted bounce-addresses.sorted > mailing-list
Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614 Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040109/e5eb2550/attachment.bin
More information about the freebsd-questions