Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will write a shell script that does a variety of tasks, including manipulating files, performing commands, and writing results to an output file. The

You will write a shell script that does a variety of tasks, including manipulating files, performing commands, and writing results to an output file.

The script should be named assignment5.sh

The script should be set up so that it can run as an executable, and it should run using the Bourne

Again shell (bash). You will need to run it on shell.cs.fsu.edu

Include comments at the top of your script file, which specify your name, the course (COP 3353),

the assignment number, and the date

Some of the tasks will involve writing results of commands to an output file. The output file

should be named "output.txt". Whenever an instruction specifies to write results to "the

output file", this is the file it refers to. The output file should be created by the script itself.

Create an empty directory from which to test the script. This is how your script will be tested

during grading -- from a directory that contains only your script file, to begin with

Any time the instructions call for printing a heading, it should look exactly like this:

=================== Heading text =================== where you substitute the specified heading text in between the lines above. Example:

 =================== Grades test 1 =================== 

Your script should perform ALL of the tasks listed below, in order, writing results to the output file where specified.

image text in transcribed

The two files filel and file2 contain similar passages oftext. Use the diff command in the following three ways to find out the differences between these two files. Each time, add the output o Header text: "diff test 1". Find the difference between the files in the simplest case (no o Header text: "diff test 2". Find the difference between the files where changes in the from each diff command to the output file, preceded by a header with the given text: amount of white space is ignored (e.g. multiple spaces would be counted as one) Header text: "diff test 3". Find the difference between the files where upper- and lower- case letters are considered equivalent, AND in which all white space is ignored when o Use the grep command to do the following searches on filel. Each use of grep should include the line numbers for each line reported in the results. Each time, add the output from the grep command to the output file, preceded by a header with the given text 0 gnorc any differences in lower-/upper-case. (e.g. in this one, "The", "the", and "THE" would all o Header text: "grep test 2". Search filel for all occurrences of the pattern "The" that Note that were only looking for this word - a word like "whomever" would not be the system. Everything in this step should be done with one command, using the ps command: Use the ps command to report on every process on the system (you should be running on shell.cs.fsu.edu, using the "full-format" listing o 0 create). Note: this is the ONLY time in the assignment that you will send output to a different file than the output.txt file). 7 o Do a directory listing of the current working directory, using the "long listing" format and send the results to the output file. Create a directory in the current location called archive contains the following files into the archive directory: o

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

Students also viewed these Databases questions