Help with Bash Shell Script Spell Checker program.

I have a majority of this problem done but seem to be struggling on the last couple of steps. Here is the whole problem to help you guys get a better understanding.

Write a shell script that implements a simple spell checker.
The filename you will use for your script will be your Z-id followed by �.spell�. For example, if your Z-id is
�z123456� then your script must be called �z123456.spell�.
The script will be invoked as:

% z123456.spell file

You are encouraged to take advantage of the �aspell list� command. It produces a list of misspelled words from
standard input.

When your script is invoked from the command line it reads �file� and checks each word it contains for proper
spelling. For each word that is found to be incorrect, the invoker is asked to either:

� confirm that the spelling used was as intended (no changes made)
� provide a replacement spelling for the word

If the invoker chooses the first option and confirms that the spelling was intended, the script will �remember�
it. Your script will �remember� words in the �/.memory� file.If the invoker chooses the first option and confirms that the spelling was intended, the script will �remember�
it. Your script will �remember� words in the �/.memory� file.
If not, the invoker will be prompted for a replacement spelling. As output, your script will produce a two columned
list of words. The left column lists incorrectly spelled words, and the right column lists their replacement
as given by the invoker. The list is produced after the invoker has chosen a response for all incorrectly spelled
words.

Example run through...

% ls
testfile z123456.spell
% cat testfile
In navigation, a vehicle�s course is the agle that the intended
path of the vehicle makes with a fixed reference objekt
(typically truenorth). Course is measured in degrees from 0
clockwise to 360 in ECMD compass convention (0 being north,
90 being east). Course is customarily expressed in three
digits, using preliminary zeros if needed.
% ./z123456.spell testfile
�agle� is mispelled. Press "Enter" to keep
this spelling, or type a correction here: angle
�objekt� is mispelled. Press "Enter" to keep
this spelling, or type a correction here: object
�truenorth� is mispelled. Press "Enter" to keep
this spelling, or type a correction here:
�ECMD� is mispelled. Press "Enter" to keep
this spelling, or type a correction here:
MISPELLED: CORRECTIONS:
agle angle
objekt object
% ./z123456.spell testfile
�agle� is mispelled. Press "Enter" to keep
this spelling, or type a correction here: angle
�objekt� is mispelled. Press "Enter" to keep
this spelling, or type a correction here: object
MISPELLED: CORRECTIONS:
agle angle
objekt object
% cat �/.memory
truenorth
ECMD
% cat testfile
In navigation, a vehicle�s course is the agle that the intended
path of the vehicle makes with a fixed reference objekt
(typically truenorth). Course is measured in degrees from 0
clockwise to 360 in ECMD compass convention (0 being north,
90 being east). Course is customarily expressed in three
digits, using preliminary zeros if needed.

Your script must have /bin/bash in its shebang line.
Make sure that your script does not leave any temporary files behind.

Okay so this is what I have so far. I was just done to the last two steps of getting the two misspelled words to print correctly into an array or something that's easier then that. The next step would be being able to have the bash file read the memory file so It does not ask for those two misspelled words you press enter into when you run the program a 2nd time through. Any help is great or a better way (and easier) is much appreciated!

#! /bin/bash

for i in `aspell list < testfile`
do

	if [ i="" ]; then        
	
	read -p "'$i' is mispelled. Press \"Enter\" to keep this spelling, or type a correction here: " check; 
	#echo $check;
	fi

#echo $check;
	if [ "$check" = "" ]; then
	echo "$i" >> memory;
	#elif [ "$check" != "" ]
	#then
		#array[2]= "$check";
	#echo ${array[@]}
	fi




done

echo "MISPELLED           CORRECTIONS"
#printf "array[]";
echo "objekt                 object"                

The echo on the end is just an example of what the output should look like. and the commented out parts are some ideas I had that I could not get to work yet or might just get rid of them all together.

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.