Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me out in the shell scripting problem 3 and 4 3. Rewrite the tps_report2 script. Preserve the concept that if the user forgets

Please help me out in the shell scripting problem 3 and 4

3. Rewrite the tps_report2 script. Preserve the concept that if the user forgets to pass command line arguments, the script will fill in useful defaults. But create a more compact way to test the arguments using nested if statements.

Here is tps_report2 script

# Use of variables within a here file.

# If the user forgets to pass the command-line

# arguments, fill in defaults.

if [ $# -lt 1 ]

then

date_required=today

else

date_require

fi

if [ $# -lt 2 ]

then

pithy_statement=Action, urgency, excellence

else

pithy_statement=$2

fi

wall <

Please complete all TPS reports and have them

on my desk by EOB $date_required.

Your cooperation in this matter helps the smooth

flow of our departmental structure.

$pithy_statement!

-Dick

EndOfText

echo Message sent

4. Rewrite the tps_report2 script using a case statement instead of if statements.

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

3. Is it a topic that your audience will find worthwhile?

Answered: 1 week ago

Question

2. Does the topic meet the criteria specified in the assignment?

Answered: 1 week ago