Question: 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

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!