From owner-freebsd-questions@FreeBSD.ORG Thu Sep 13 18:19:46 2007 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8A4D16A553 for ; Thu, 13 Sep 2007 18:19:46 +0000 (UTC) (envelope-from kurt.buff@gmail.com) Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.180]) by mx1.freebsd.org (Postfix) with ESMTP id 56CDA13C468 for ; Thu, 13 Sep 2007 18:19:46 +0000 (UTC) (envelope-from kurt.buff@gmail.com) Received: by el-out-1112.google.com with SMTP id r27so148535ele for ; Thu, 13 Sep 2007 11:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=ICcTjAWZrtP0a+98ug+ILeBaaQ1V1kK9hXDQp+u9288=; b=mgdkVkcSQvBJ6gFWFDOSn172OEcasp8Y5YF9SH5cMsViutk2TMbDnkY90R5dXhUxY7gvaDkXy87n69zCGWlY4VfsaAbG1hq+34kDlXQMffrWZp/eBW4AydqP6uOYq8BHTJBBEtNv2W2OH9OcQ1e9FUiBPuQeGQIJlMEym9AI5Gg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pcD+Yhz9Vtpv0xOCTAHItI8sj/q3KjmuXPzXoyYTn6ZBClgla9nxiYqqrfatCIX5ChpdYiy/y7rQD1ormN1HDxy3xy8for/YFMpGr8WrMSIIU+WpWCGFKPY/HKFXL4Q/+Eyu2WAcDa6EwqiNBNDo93VoqQ6rml/BcTdvSGYjZyE= Received: by 10.142.178.13 with SMTP id a13mr187921wff.1189707584682; Thu, 13 Sep 2007 11:19:44 -0700 (PDT) Received: by 10.142.78.21 with HTTP; Thu, 13 Sep 2007 11:19:44 -0700 (PDT) Message-ID: Date: Thu, 13 Sep 2007 11:19:44 -0700 From: "Kurt Buff" To: "Jerry McAllister" In-Reply-To: <20070913175510.GA78984@gizmo.acns.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070913172001.GA78799@gizmo.acns.msu.edu> <20070913175510.GA78984@gizmo.acns.msu.edu> Cc: questions@freebsd.org Subject: Re: Scripting question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2007 18:19:46 -0000 On 9/13/07, Jerry McAllister wrote: > > The only space is the one separating the SMTP address from the OK or NO. > > Then you should be able to tell it to sort on the first token in > the string with white space as a separator and to eliminate > duplicates. It has been a long time since I had need of sort. I > don't remember the arguments/flags but am sure that type of thing can be done. > > ////jerry Ya know, it's really easy to get wrapped around the axle on this stuff. I think I may have a better solution. The file I'm trying to massage has a predecessor - the non-unique lines are the result of a concatenation of two files. Silly me, it's better to 'grep -v' with the one file vs. the second rather than trying to merge, sort and further massage the result. The fix will be to use sed against the first file to remove the ' NO', thus providing a clean argument for grepping the other file. Sigh. Kurt