Question: Write a shell script in Linux with the following specifications: name of script: whichday purpose: displays the day of the week on which a particular

Write a shell script in Linux with the following specifications:

name of script: whichday

purpose: displays the day of the week on which a particular date falls, for example, bash whichday Mar 9 2016. Then the result should be Wednesday.

arguments: with none, it will write to stdout a display of the correct arguments: Please enter month day year (example: Jan 5 2002)

Then write whichyears, it operates similar to whichday, that is no arguments, it displays a message saying what the arguments should be. With command line arguments similar to whichday, it finds all of the years starting from the year entered, in which the specified date falls on the same day of the week as it did in the given year. For example, if you enter: bash whichyears Apr 5 1991 it will display:

Apr 5 1991 Friday , Apr 5 1996 Friday , Apr 5 2002 Friday , Apr 5 2013 Friday. This script simply searches all the way to the current year (2016) looking for a year in which the given date falls on the same day as the given date fell in the given year.

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!