From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rich Glazier Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: difference between two files Date: Tue, 08 Jun 2010 15:07:53 -0700 (PDT) Message-ID: <81769.66997.qm@web112405.mail.gq1.yahoo.com> References: <906752.60554.qm@web112404.mail.gq1.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1276034902 19035 80.91.229.12 (8 Jun 2010 22:08:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Jun 2010 22:08:22 +0000 (UTC) To: Tru64-UNIX-Managers@ornl.gov Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Wed Jun 09 00:08:20 2010 connect(): No such file or directory Return-path: Envelope-to: gotm-tru64-unix-managers@lo.gmane.org Original-Received: from sws1.ornl.gov ([160.91.1.101]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1OM6y1-0004K4-TQ for gotm-tru64-unix-managers@lo.gmane.org; Wed, 09 Jun 2010 00:08:18 +0200 Original-Received: (qmail 10443 invoked by uid 49509); 8 Jun 2010 22:08:03 -0000 Original-Sender: tru64-unix-managers-owner@ornl.gov Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 10432 invoked by uid 49501); 8 Jun 2010 22:08:03 -0000 Original-Received: from 160.91.4.119 by sws1 (envelope-from , uid 49491) with qmail-scanner-1.25 (clamdscan: 0.83/743. spamassassin: 3.0.2. Clear:RC:0(160.91.4.119):SA:0(-2.6/5.0):. Processed in 0.541066 secs); 08 Jun 2010 22:08:03 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 Original-Received: from emroute1.ornl.gov (160.91.4.119) by sws1.ornl.gov with SMTP; 8 Jun 2010 22:08:02 -0000 Original-Received: from emroute1.ornl.gov ([127.0.0.1]) by emroute1.ornl.gov (PMDF V6.5 #31823) with ESMTP id <0L3P00M8DUTEEG@emroute1.ornl.gov> for tru64-unix-managers@sws1.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov); Tue, 08 Jun 2010 18:08:02 -0400 (EDT) Original-Received: from CONVERSION-DAEMON.emroute1.ornl.gov by emroute1.ornl.gov (PMDF V6.5 #31823) id <0L3P00301UTEIH@emroute1.ornl.gov> for tru64-unix-managers@sws1.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov); Tue, 08 Jun 2010 18:08:02 -0400 (EDT) Original-Received: from VIRUSCAN-DAEMON.emroute1.ornl.gov by emroute1.ornl.gov (PMDF V6.5 #31823) id <0L3P00302UT6IA@emroute1.ornl.gov> for tru64-unix-managers@sws1.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov); Tue, 08 Jun 2010 18:08:02 -0400 (EDT) Original-Received: from web112405.mail.gq1.yahoo.com (web112405.mail.gq1.yahoo.com [98.137.26.137]) by emroute1.ornl.gov (PMDF V6.5 #31823) with SMTP id <0L3P001RSUT5U4@emroute1.ornl.gov> for tru64-unix-managers@sws1.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov); Tue, 08 Jun 2010 18:07:54 -0400 (EDT) Original-Received: (qmail 71122 invoked by uid 60001); Tue, 08 Jun 2010 22:07:53 +0000 Original-Received: from [65.114.238.246] by web112405.mail.gq1.yahoo.com via HTTP; Tue, 08 Jun 2010 15:07:53 -0700 (PDT) In-reply-to: <906752.60554.qm@web112404.mail.gq1.yahoo.com> X-Envelope-from: rglazier2002@yahoo.com X-Mailer: YahooMailRC/397.8 YahooMailWebService/0.8.103.269680 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1276034873; bh=cVZ0UHTIPBK/idCxdr8gH+JYMKP/9ddGj/fLHPFNY4I=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ljSvWqmCGf0dU1X6JBx74qKnvkZpEsRpTeIonXHHdyRiuVVEbyCvjZmT7JsZF3HWqAH1/z2bQA2RidPhOX05uZIkwEDbcCaJdRRHQDHhFFN56qxXkniaCiLkg5mIHiLJvFY4JExK0fa151/xV2LJGpMKR6TTq2xj/3o22+oZBxU= X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on spam2.ornl.gov X-Spam-Level: * X-Qmail-Scanner-MOVED-X-Spam-Status: No, score=1.3 required=5.0 tests=AWL,BAYES_00, BOTNET_SERVERWORDS,DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.1 X-Spam-Relay-Country: US US X-YMail-OSG: U0ropS4VM1nGXKmbk6Mw_9S5Df9fo43VPXY40LgRJHTTJqf ueyFR4lyErs8H2DpvoE6bBZJqLINx.TZcsS0B5xJTSuIJ7NBmRmST9hxfryT a_eZtuLiOhDIILdqDHAoI46KRPamy7tJinn0a.BlD3PZ4Yq77iaz5exbWi7i XgCWzb1SexDESOqYSvFA3.k4pYdRIYAMhLEtKyLMIlmOmDLoS4AEBWNePZ9B GJ8KyVozFDeokmjkUQqTmPYWahGkVFIVc1yEfdzNICxtot53DxCC8TREojyu q5hCO5pNEbBVgknFpZ5HQ.2pgvTljs34QFqyHQiVLLog9XSSibwwScObmbqJ .TZoIydnD DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ZYGs13Em2hOB5VH70muH0NyzHPKFa++N/5s67ZJ4NmNkqhTQrZuXfUZkAj9NgogQYNTknJ/cFvbGC8NZsl5/DhoJlQB9FYyuqfwmwOO7ir8Vp9hM7SeJPGE9LbPk7LhS/epWSBL8M9xqZRfw7Ge1JKyDo+Y9azBnG57jEoBD0wk=; Xref: news.gmane.org gmane.os.tru64.managers:9443 Archived-At: Thanks to all the responses I got. The one I went with was to sort and uniq= the the files, and then compare them using 'comm'.=0A=0Asort -u file1 > fi= le1.sorted=0Asort -u file2 > file2.sorted=0Acomm -13 file1.sorted file2.sor= ted=0A=0AThe '1' flag for comm says 'suppress lines unique to FILE1'=0AThe = '3' flag for comm says 'suppress lines that appear in both files'=0A=0ASinc= e I only cared about what was in file2 that wasn't in file1, these options = worked.=A0 In my example below the "1" option wouldn't really=A0be necessar= y because there's nothing in file1 that isn't in file2, but for my real wor= ld files this covered both lines only in file1 and also lines both in file1= and file2. Or in-other-words, lines only in file2 that aren't in file1.=0A= =0A=0A=0A----- Original Message ----=0AFrom: Rich Glazier =0ATo: Tru64-UNIX-Managers@ornl.gov=0ASent: Mon, June 7, 2010 12:21:= 52 PM=0ASubject: difference between two files=0A=0AI have two files somethi= ng like this:=0A=0Afile 1=0A-------=0A1=0A2=0A4=0A5=0A6=0A8=0A9=0A=0Afile2= =0A-----=0A1=0A2=0A3=0A4=0A5=0A6=0A7=0A8=0A9=0A=0Ai want to strip out only = what's different in file 2 from file 1.=A0 the output would only be 3 and 7= .=A0 i've tried using diff, sort, uniq, and comm but can't quite seem to ge= t what i need.=0A=0Aany thoughts?=0A=0Athanks!!=0A=0A-Rich=0A=0A=0A