Question: a) Write a bash script that (1) prompts the user to enter a Linux command, (2) prints out the users entered command to be executed,

a) Write a bash script that (1) prompts the user to enter a Linux command, (2) prints out the users entered command to be executed, and finally (3) executes the users entered command. The Linux command is to be read in, not passed as a command- line argument.

b) 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 (i.e., an error printed out for the user). Assume the user enters all input in lowercase. 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.

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!