From owner-freebsd-questions@FreeBSD.ORG Fri Jan 9 07:48:37 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2936316A4CE for ; Fri, 9 Jan 2004 07:48:37 -0800 (PST) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6EF4243D2F for ; Fri, 9 Jan 2004 07:48:34 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i09FmS0I023523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Jan 2004 15:48:28 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i09FmS6F023522; Fri, 9 Jan 2004 15:48:28 GMT (envelope-from matthew) Date: Fri, 9 Jan 2004 15:48:28 +0000 From: Matthew Seaman To: "Jack L. Stone" Message-ID: <20040109154828.GA23424@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , "Jack L. Stone" , freebsd-questions@freebsd.org References: <3.0.5.32.20040109091937.014b2378@10.0.0.15> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: <3.0.5.32.20040109091937.014b2378@10.0.0.15> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.61 X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: Scripting help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2004 15:48:37 -0000 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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 tedio= us > to try and keep the lists up to date (groan). >=20 > 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, th= en > delete from the main lists (also one address per line). >=20 > 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 =20 Cheers, Matthew --=20 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 --1yeeQ81UyVL57Vl7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQE//s1MdtESqEQa7a0RAsYiAKCT1tuCVgDm+3il0WThW6koCPyrDwCfZrKM glFXvz6AgdOQqyfoqCR0940= =MkEy -----END PGP SIGNATURE----- --1yeeQ81UyVL57Vl7--