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