Task details You are required to write a Bourne Again Shell Script (bash) to manage a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Task details 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. Task details 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.
Expert Answer:
Answer rating: 100% (QA)
Link httpsreplitreplsTightEachClicks Code binbash sta... View the full answer
Related Book For
Introduction to Business Law
ISBN: 9780324826999
3rd Edition
Authors: Jeff rey F. Beatty, Susan S. Samuelson
Posted Date:
Students also viewed these general management questions
-
An operation has a 10 percent s crap rate. As a result, only 82 good pieces per hour are produced. What is the potential increase in labour productivity that could be achieved by eliminating the...
-
What is the central issue in this case?
-
What is the man-in-the-middle attack? Can this attack occur when symmetric keys are used?
-
write a note on Moll Cutpurse Life?
-
1. What implications WiMax have for existing established traditional telephone companies. 2. Beyond television, what other new capabilities could be enabled by this technological innovation? 3. What...
-
Sarah Fluggel is considering the purchase of a home located at 2121 Tarter Circle in Frisco, Texas. The home has 3,000 square feet of heated and cooled living area, and the current owners are asking...
-
How does text mining provide value? Give an example?
-
Busch Corporation has an existing loan in the amount of $4.5 million with an annual interest rate of 5.5%. The company provides an internal company-prepared financial statement to the bank under the...
-
April 4 - You register your business name with Service Ontario for $ 6 0 , using the business credit card. How will FF - Up record the April 4 transaction? ( 1 point ) increase Business Licence and...
-
A representative section from a composite lamina is shown in figure 2.19 along with the transverse stress and strain distributions across the fiber and matrix materials in the section. The composite...
-
Which of the following statements best describes an indirect cost? A. An indirect cost can be easily and accurately traced to a cost object B. An indirect cost is assigned to a cost object using...
-
Write a method public static copyFiles(Path fromDir, Path toDir) that copies all files (but none of the directories) from one directory to another.
-
Worked Example 19.1 showed you how to find all words with five distinct vowels (which might occur more than once). Using a similar approach, find all words in which each vowel occurs exactly once....
-
For each of the following scenarios, describe the type of conflict that is being represented: a. Hadley Primary Care Group in John- son, Vermont, has been in the community for 35 years. The senior...
-
Explain the relative emphasis that would be placed on advertising or personal selling in each of the following situations: (a) a manufacturer of an infusion pump therapy kit for use in hospitals, (b)...
-
As the marketing director of a major capital equipment manufacturer, you are present- ing at an upcoming meeting of the Ameri- can College of Health Care Executives.. Hospital chief executive...
-
#1. [4 points] To find the value of gravitational acceleration (g), a student uses a simple pendulum for which the time period (T) is given by T = 2 where I is the length of the pendulum. The student...
-
Explain the term global capital markets. This chapter primarily discusses global equity markets. What other types of financial instruments are traded in these markets? How important are global...
-
1. What was going on in this case? 2. Why didnt Sterling keep the note that Mary Johnson signed? 3. Why did Mayflower and the Lender think they could enforce a note that contained this language?
-
Is resale price maintenance a per se or rule of reason violation of the Sherman Act?
-
1. What is a disabled person? 2. The twin sisters had 20/200 vision. Were they disabled?
-
A manager has been using a certain technique to forecast demand for project man- agement software at her store. Actual demand and her corresponding predictions are shown below: a. What was the...
-
Why aren't the effective capacity and the optimal operating level of any operation necessarily the same amount of activity?
-
A certain facility has a design capacity of 2,500 units a day and an effective capacity of 2,225 units. Name one potential determinant of its effective capacity.
Study smarter with the SolutionInn App