From owner-freebsd-questions@FreeBSD.ORG Fri Aug 13 14:01:39 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13A321065695 for ; Fri, 13 Aug 2010 14:01:39 +0000 (UTC) (envelope-from j.mckeown@ru.ac.za) Received: from d.mail.ru.ac.za (d.mail.ru.ac.za [IPv6:2001:4200:1010::25:4]) by mx1.freebsd.org (Postfix) with ESMTP id 096058FC19 for ; Fri, 13 Aug 2010 14:01:38 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=ru-msa; d=ru.ac.za; h=Received:From:Organization:To:Subject:Date:User-Agent:References:In-Reply-To:X-Face:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id:X-Virus-Scanned:X-Authenticated-User; b=AloNDtnpZdgHiqDdEH+jAS4TdvH4NEpSksf9cvoA1SFIaKh4O88j/Znnhjg6ST+7UB+Dnfo8OC+BvC4F+ORby8Urmju8cwdwizFcrBA/q8KRAS70n5F6licEVWbXu+a9; Received: from vorkosigan.ru.ac.za ([2001:4200:1010:1058:219:d1ff:fe9f:a932]:59256) by d.mail.ru.ac.za with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1OjupC-000LFh-M0 for freebsd-questions@freebsd.org; Fri, 13 Aug 2010 16:01:35 +0200 From: Jonathan McKeown Organization: Rhodes University To: freebsd-questions@freebsd.org Date: Fri, 13 Aug 2010 16:01:34 +0200 User-Agent: KMail/1.9.10 References: <867hjv92r2.fsf@gmail.com> <3.0.1.32.20100813084738.00ee5c48@sage-american.com> In-Reply-To: <3.0.1.32.20100813084738.00ee5c48@sage-american.com> X-Face: $@VrUx^RHy/}yu]jKf/<4T%/d|F+$j-Ol2"2J$q+%OK1]&/G_S9(=?utf-8?q?HkaQ*=60!=3FYOK=3FY!=27M=60C=0A=09aP=5C9nVPF8Q=7DCilHH8l=3B=7E!4?= =?utf-8?q?2HK6=273lg4J=7Daz?=@1Dqqh:J]M^"YPn*2IWrZON$1+G?oX3@ =?utf-8?q?k=230=0A=0954XDRg=3DYn=5FF-etwot4U=24b?=dTS{i X-Virus-Scanned: d.mail.ru.ac.za (2001:4200:1010::25:4) X-Authenticated-User: s0900137 from vorkosigan.ru.ac.za (2001:4200:1010:1058:219:d1ff:fe9f:a932) using auth_plaintext Subject: Re: Grepping a list of words 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: Fri, 13 Aug 2010 14:01:39 -0000 On Friday 13 August 2010 15:47:38 Jack L. Stone wrote: > The only thing it didn't do for me was the next step. My final objective > was to really determine the words in the "word.file" that were not in the > "main.file." I figured finding matches would be easy and then could then > run a sort|uniq comparison to determine the "new words" not yet in the > main.file. > > Since I will have a need to run this check frequently, any suggestions for > a better approach are welcome. sort -u and comm(1)? comm will compare two sorted files and produce up to three lists: of words only in file one, of words only in file 2 and of words common to both files. You can suppress any or all of the output lists. Jonathan