Question: Consider the following bash script /cs2211/a2/good.sh: #!/ bin/ bash echo hour =` date +%H` if [ $hour -lt 12 ]; then echo
Consider the following bash script /cs2211/a2/good.sh:
#!/ bin/ bash echo hour =` date +%H` if [ " $hour " -lt 12 ]; then echo " GOOD MORNING " elif [ " $hour " -lt 18 ]; then echo " GOOD AFTERNOON " else echo " GOOD EVENING " fi echo
(a).Rewrite this script to not use elif.
(b).Add a few lines to the end of this shell script to also output \Thank Goodness It's Friday" if it is Friday, \It's Wednesday My Dudes" if it is Wednesday and \Have a Nice Weekend" if it is Saturday or Sunday. For all other days of the week do not output any additional text. You may use any type of conditional statement to add this feature.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
