spell checker program

2.I need shell script to list all the 'words' in a
given file (text) that are not listed in a specified
dictionary. Let us call this utility 'spell-check'.
'spell-check' will be called as follows.

$ spell-check letter
Lucent
UNIX
UNIX
OS
a
$

dictionary words are listed in lower case. Thus 'spell-check'
will have to convert words in its input to lower case before
looking up the dictionary. However, when displaying possible
misspellings, words should be printed as they appear in input.
'spell-check' should take the path for the dictionary from
the environment variable SPELL_CHECK_DICT.

'spell-check' should treat any sequence of letters as a word.
Digits, whitespace, punctuation characters will act as delimiters.

It should be possible to use 'spell-check' in a pipe as:-

$ cat letter | spell-check | sort
a
Lucent
OS
UNIX
UNIX
$
I have a program
$ spell-check()
for NAME in (cat $1)
do
if grep -i-s $NAME $SPELL_CHECK_DICT
then
else
echo $NAME
fi
done

I must be missing something. Most unix systems have spell. This provides exactly what you want.

Ask your sysadmin if your system has spell installed, or maybe ask to have it installed if one is available.
usage

spell textfile

Exactly - why rewrite commands unless it's homework.

Please read the rules.

This...

...is just a list of requirements taken from an assignment sheet.

Thread closed.

Thanks,
ZB