Using diff for spellchecking

Hi,

I am attempting to use diff for the purpose of spell checking. Here is what I have thus far. I am using the Bourne shell (sh).

diff -i list.txt '/usr/share/dict/words'

I am comparing my list of words (list.txt) with another list (a dictionary).

Here is what is contained in list.txt:

brown
brown
brown
fjkjk
fox
fox
I
I
I
I
is
is
is
is
the
the
The
this
this
this
this
Thursday
Today

I get output like the following: (just a part of the output)

> browis
> browless
> browman
3,4c53558,75240
< brown
---
> brown-armed
> brownback
> brown-backed

I thought that the "<" meant that the word was found in my file but not in the dictionary and thus not a correctly spelled word. However, it is doing this for "brown" as well as others later down the list. I also think that the ">" means that the word is in the dictionary but not in my file, meaning just that I can ignore it. I need some way of getting words that aren't in the dictionary using the diff utility.

Thanks for your time

Do you need look for the words in list.txt which are not in dictory?

awk 'NR==FNR{a[$0];next} ! tolower($1) in a' /usr/share/dict/words list.txt

Yes, this is what I need to do. I need to find the words that are in list.txt, but not in the dictionary. After I find these words, I need to display them and the line number they occur on (in list.txt).

---------- Post updated at 01:58 PM ---------- Previous update was at 01:08 AM ----------

I ended up figuring out my issue. I needed to remove duplicates after sorting my list of words.

export the line number as well.

awk 'NR==FNR{a[$0];next} ! tolower($1) in a {print NR, $0}' /usr/share/dict/words list.txt