Developing a shell script to display a menu card


Task:

Develop a Shell script named “menu” to display Special of the day, depending on the day of the week. The specials are:

Monday Lobster Platter
Tuesday  Sea Food Salad
Wednesday Steak and Fish Combo
Thursday King Crab
Friday Prime Ribs
Saturday Jumbo Shrimp
Sunday Triple Delight

Synopsis:

menu [-d day][-a]

Description:

If no argument is entered by the user, the program checks the system date for today's day and displays the appropriate Special. The “[-d day]” denotes that this program allows a day of week to be specified. In other words, when this option is used, the program displays Today's Special for the specified day. The “[-a]” option will display all Specials. It is NOT allowed to specify both “[-a]” and “[-d day]” options at the same time. When validating the entered day, the program ignores the case sensitivity and checks only the first three characters; thus, Mon, mOn, and mon will all be interpreted as Monday.

Shown below are some sample runs of the above script:

UNIX> menu
Monday special is: Lobster Platter
UNIX> menu -d wEd
Wednesday special is: Steak and Fish Combo
UNIX> menu -d what
what is an invalid day
UNIX> menu -a -d Mon
-a and -d cannot be used at the same time
UNIX> menu -k Sun
-k is an invalid option

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Developing a shell script to display a menu card
Reference No:- TGS01822

Expected delivery within 24 Hours