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 > file. > > 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 Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK
pgp00000.pgp
Description: PGP signature