spell check program

hi,

i need to write a spell check program in bash to find all possible spelling errors in a file or a number of files taken as input using usr/dict/words.

whenever the program encounters a spelling error, it must state the line number at which the incorrect spelling has occured and underline the word along with the entire life

for example,

11 --- apple apple applle (underlined) apple

i would appreciate any suggestions.

thank you

not exactly what you want, but hope can help you some.

#!/usr/bin/perl
use strict;
my %hash=('happy',1,'hello',1,'are',1,'you',1,'first',1,'talk',1);
open FH,"<a.txt";
while(<FH>){
  chomp;
	my @tmp=split(/ +/,$_);
	map {(exists $hash{$_})?print $_," ":print "<",$_,"> " } @tmp; 
	print "\n";
}
close FH;
__END__
a.txt
Are you happy?
Is it the first time that you come here?