Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fully Functional Script in BASH In this section, you will write a fully functional script to help your manager with an important project that will

Fully Functional Script in BASH

In this section, you will write a fully functional script to help your manager with an important project that will build upon what you learned from your script work in Milestone Four. After you have written the script, you will execute it to generate a report for all three users (once for Bob, once for Henry, and once for Frank). You should have three unique generated reports in your ~/scripts directory (or more if you ran it multiple times per user). This script will be showcased to upper management and should demonstrate your best work.

Write the Script:

Write a fully functional and professional looking script that meets all of the following requirements.

1. Resides within your ~/scripts directory and is named tps-report-gen.sh.

2. Take a supplied users first name (Bob, Henry, or Frank) in any order when the script is executed (for example: sh tps-reportgen.sh bob).

3. Print out to the screen the text: TPS REPORT LISTING

4. A double newline.

5. Print out to the screen neatly the users name, company position, and home directory path on one line.

6. A double newline.

7. A list of TPS Reports associated with that user.

8. A double newline.

9. Print out to the screen the text: END REPORT LISTING

10. The script needs to print the output to the screen and generate a report into the same directory as the script named tps-list-USERDATETIME.rpt. USER would be the user's username and DATETIME would be the date and time that the report was run. USER and DATETIME would both change based on the username supplied and the date and time the script is executed. It may be easier to build the report file first, then simply cat the file to the screen within the script. An example report would look like:

tps-list-bob-030816624.rpt

HINT: To get the DATETIME portion formatted as requested use the following: date "+%m%d%y%k%M" | awk -F" " {'print $1$2'}

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago

Question

3-38. You want to be hired for a job.

Answered: 1 week ago