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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started