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:
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...
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!
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.
I am attempting to write a korn shell script that does the following, but I am getting errors. I'm new to korn shell scripting and am not sure what I am doing wrong. Please help with example scripts. Thanks.
1) check for day of the week
2) if day of the week is Monday then check for the... (4 Replies)
Guys I am new to Linux in general and want to know what is the use of the following files-:
/usr/share/dict/words
/usr/share/dict/words.pre-dictionaries-common
Are they used by the spell checker to find potential typos ?
If so are there any better larger word lists out there ? I am sure... (2 Replies)
Hi,
This is my program.
#!/bin/bash
today=`date +"%b-%d-%Y"`
SERVICE="pbxconnect.php"
if ; then
echo "pbx program is running"
else
nohup php pbxconnect.php > logpbx-$today.txt &
fi
On executing using "sh myprogram.sh" , i get the following error.
myprogram.sh: line 4: '
My... (7 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
When "niuspell" is invoked from the command line it reads "file" and checks it for spelling of the words it... (1 Reply)
hello, im a new member to the forum and im doing a assignment for unix command and we have to make a spell checker and im a little confused about the directions .. ill post them below and continue..
Northern Illinois University
CSCI 330-Unix Command
Write a shell script that implements a... (1 Reply)
Hi,
Want to know is there any command to correct the spelling using unix or python? Unix command "spell" will give only the list of the incorrect words . But i want the output along with the corrected word .
Thanks in advance (1 Reply)
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... (1 Reply)
Hi Folks. I am currently working on a script that has to spell check a file and print the output to the screen in 2 columns like this.
INCORRECT CORRECTION
whio who
weahter weather
The file will allow the user to override the ispell command and save any... (9 Replies)
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... (2 Replies)
I have a rather big script that i have written in ksh and it is falling over in two places with a 'test argument' error. I know this usually means that the if statement is not correct, but it is fine. I have looked through the rest of the script for any odd brackets or ` marks, but can't see... (2 Replies)