Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. Write a shell script, sameDow. sh, that takes two dates as arguments in the form YYYY-MM-DD (e.g. 2018-10-01) and determines whether the two dates
4. Write a shell script, sameDow. sh, that takes two dates as arguments in the form YYYY-MM-DD (e.g. 2018-10-01) and determines whether the two dates occurred on the same day of the week. Report an error if either of the dates given is notin the correct format or an invalid date. The input and output to/from the script should essentially follow this format: an example where the days of the week don't match $./sameDow.sh 2018-09-30 2018-10-01 First day of the week is a Sunday Second day of the week is a Monday Days of the week don't match. an example where the days of the week do match $ ./sameDow.sh 2018-09-24 2018-10-01 First day of the week is a Monday Second day of the week is a Monday Days of the week match Hint: Read the documentation for the UNIX date command before writing any code. 4. Write a shell script, sameDow. sh, that takes two dates as arguments in the form YYYY-MM-DD (e.g. 2018-10-01) and determines whether the two dates occurred on the same day of the week. Report an error if either of the dates given is notin the correct format or an invalid date. The input and output to/from the script should essentially follow this format: an example where the days of the week don't match $./sameDow.sh 2018-09-30 2018-10-01 First day of the week is a Sunday Second day of the week is a Monday Days of the week don't match. an example where the days of the week do match $ ./sameDow.sh 2018-09-24 2018-10-01 First day of the week is a Monday Second day of the week is a Monday Days of the week match Hint: Read the documentation for the UNIX date command before writing any code
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