Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Aug 2010 16:01:34 +0200
From:      Jonathan McKeown <j.mckeown@ru.ac.za>
To:        freebsd-questions@freebsd.org
Subject:   Re: Grepping a list of words
Message-ID:  <201008131601.34182.j.mckeown@ru.ac.za>
In-Reply-To: <3.0.1.32.20100813084738.00ee5c48@sage-american.com>
References:  <867hjv92r2.fsf@gmail.com> <3.0.1.32.20100813084738.00ee5c48@sage-american.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008131601.34182.j.mckeown>