Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a shell script that implements a simple spell checker. The name of your script is formed from your Z-id followed by .spell. For example,

Write a shell script that implements a simple spell checker. The name of your script is formed from your Z-id followed by ".spell". For example, if your Z-id is "z123456" then your script must be called "z123456.spell".

The general format for invocation is:

z123456.spell file

where "z123456.spell" is the name of the executable file that contains your shell script, and "file" refers to the file to be checked word-by-word for spelling.

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

Specification:

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

  • to insist on the spelling of the word.
  • to provide a replacement spelling

If the invoker insists on the spelling of the word, then your script will "remember" it. Your script "remembers" words in the file "~/.memory" in the invoker's home directory. Any further invocation of your script by the same invoker will consider the word to be correct.

Otherwise, the invoker is prompted for a replacement spelling. As output, your script produces a 2-column-ed list of words, the left column lists incorrectly spelled words, the right column lists their replacement as given by the invoker. The list is produced after the invoker has answered to all incorrectly spelled words.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions