Question: You are required to write a Bourne Again Shell Script (bash) to manage a menu-driven program. When executed the user should be presented with a

You are required to write a Bourne Again Shell Script (bash) to manage a menu-driven program.

When executed the user should be presented with a menu with four (4) options:

1.Print the following user information: the home directory, print files and folder in column format, user id, login shell together with the current date and time.

2.Reads a set of numbers between 0 and 100 until a sentinel value is entered. Use the value -99 as the sentinel value to terminate the loop. The idea of a sentinel controlled loop is that there is a special value (the 'sentinel') that is used to say when the loop is done.

3.Print out the average, highest number and the lowest number of the entered numbers, also list all numbers above the average.

4.Exit the program.

Requirements

Your script must allow one of these options to be chosen at a time. The menu must be presented repeatedly, until the fourth option (exit) is chosen. An appropriate error message must be displayed if an invalid option is chosen.

Option 1: your script should list the specified environment variables - the home directory, print files and folder in column format, user id, login shell together with the current date and time.

Option 2: should read a set of positive integer numbers between 0 and 100 until a sentinel value (-99) is entered. It then display all the positive integer numbers entered.

Option 3: should list the average, highest and lowest number of the entered numbers as well as displaying all entered numbers that are above the average.

Option 4: should cause a graceful exit from the menu and the whole program.

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!