Question: Homework: Scripting in the shell For the homework assume you re in the standard C or POSIX locale. The shell command locale should output LC
Homework: Scripting in the shell
For the homework assume youre in the standard C or POSIX locale. The shell command locale should output LCCTYPEC or LCCTYPE"POSIX". If it doesnt use the following shell command:
export LCALLC
and make sure locale outputs the right thing afterwards.
Shell scripting
Steve Parker, Shell Scripting Tutorial
The Open Group, Shell Command Language This is the standard for POSIX shells, and you are not expected to read it all, though it can be handy to refer to it
Read enough about the shell to understand how to do IO redirection and pipes.
For each command tr sort, comm, read the commands man page and use that to deduce what the command should do given its operands shown below.
Examine the SEASnet file usrsharedictlinuxwords, which contains a list of English words, one per line. Each word consists of one or more ASCII characters.
Use sort with and to sort this file and put the sorted output into a file sorted.words.
Then, take a text file containing the HTML in this assignments web page, and run the following commands with that text file being standard input. Also, look generally at what each command outputs in particular, how its output differs from that of the previous command and why.
tr c AZaz
tr cs AZaz
tr cs AZaz
sort
tr cs AZaz
sort u
tr cs AZaz
sort u comm sorted.words
tr cs AZaz
sort u comm sorted.words
Lets take the last command as the crude implementation of an English spelling checker. This implementation mishandles the input file usrsharedictlinuxwords! Verify this by running a command like this and inspecting the output:
tr cs AZaz
mywords
Submit
myspell. This should not have a file name extension; for example, it should not be myspell.sh
makedict. This also should lack a file name extension. Do not submit this file if your myspell script can operate without an auxiliary dictionary file to read.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
