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 LC_CTYPE="C" or LC_CTYPE="POSIX". If it doesnt, use the following shell command:
export LC_ALL='C'
and make sure locale outputs the right thing afterwards.
Shell scripting
Steve Parker, Shell Scripting Tutorial (2023)
The Open Group, Shell Command Language (2018). 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 I/O 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 /usr/share/dict/linux.words, 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 'A-Za-z''[
*]'
tr -cs 'A-Za-z''[
*]'
tr -cs 'A-Za-z''[
*]'| sort
tr -cs 'A-Za-z''[
*]'| sort -u
tr -cs 'A-Za-z''[
*]'| sort -u | comm - sorted.words
tr -cs 'A-Za-z''[
*]'| sort -u | comm -23- sorted.words
Lets take the last command as the crude implementation of an English spelling checker. This implementation mishandles the input file /usr/share/dict/linux.words! Verify this by running a command like this and inspecting the output:
tr -cs 'A-Za-z''[
*]' my.words
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!