Grepping a list of words
Jonathan McKeown
j.mckeown at ru.ac.za
Fri Aug 13 14:01:39 UTC 2010
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
More information about the freebsd-questions
mailing list