Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Write a bash script that will dynamically print out the day of the week (i.e., Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday) that

image text in transcribed

3. Write a bash script that will dynamically print out the day of the week (i.e., "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", or "Saturday") that corresponds to the argument that the user specifies. This script will accept one positional parameter for which day to print. Acceptable values can be: "yesterday", "today", or "tomorrow". Anything else should result in a usage statement output to the terminal (i.e., an error printed out for the user). Assume the user enters all input in lowercase. This bash script should be called rec04C. sh As a helpful hint, you can use the date command. The -d option allows you to specify a time different than the current time. For example, the -d'-7day" format gives the date for seven days ago in the past. The '+A' format sequence prints out the full weekday name. See man date for further help on the date command Note that the script in SAMPLE OUTPUT was run on a Friday SAMPLE OUTPUT (input in bold green): $ ./Rec03C.sh Invalid option. Use "yesterday", "today", or "tomorrow" $ ./Rec03C.sh today Friday $ ./Rec03C. sh vesterday Thursday ./Rec03C.sh tomorrow Saturday $ ./Rec03C.sh someday Invalid option. Use "yesterday", "today", or "tomorrow" 3. Write a bash script that will dynamically print out the day of the week (i.e., "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", or "Saturday") that corresponds to the argument that the user specifies. This script will accept one positional parameter for which day to print. Acceptable values can be: "yesterday", "today", or "tomorrow". Anything else should result in a usage statement output to the terminal (i.e., an error printed out for the user). Assume the user enters all input in lowercase. This bash script should be called rec04C. sh As a helpful hint, you can use the date command. The -d option allows you to specify a time different than the current time. For example, the -d'-7day" format gives the date for seven days ago in the past. The '+A' format sequence prints out the full weekday name. See man date for further help on the date command Note that the script in SAMPLE OUTPUT was run on a Friday SAMPLE OUTPUT (input in bold green): $ ./Rec03C.sh Invalid option. Use "yesterday", "today", or "tomorrow" $ ./Rec03C.sh today Friday $ ./Rec03C. sh vesterday Thursday ./Rec03C.sh tomorrow Saturday $ ./Rec03C.sh someday Invalid option. Use "yesterday", "today", or "tomorrow

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago