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?
-
Output from a process was used to produce the following control chart: Based on the chart produced, would you conclude that the process is in control or not? Justify your answer. 7 5 2 642086420
-
Review the extended marketing mix (7Ps) and for each element of the mix identify an important change in the digital context.
-
The accounting records for Airborne Services, Corp., contain the following amounts on December 31,2010. The accounts appear in no particular order. Prepare the trial balance for Airborne Services at...
-
The March 31, 2020, adjusted trial balance for Amusement Park Repair is shown below with accounts in alphabetical order. Required Preparation Component: a. Place an X in the space provided beside...
-
(a) Determine the torque that can be applied to a solid shaft of 50-mm diameter without exceeding an allowable shearing stress of 45 MPa. (b) Solve Part a, assuming that the solid shaft has been...
-
Bill Jovi is reviewing the cash accounting for Nottleman, plc, a local mailing service. Jovis review will focus on the petty cash account and the bank reconciliation for the month ended May 31, 2022....
-
Question 1 Liquid Hair's demand for bottles of shampoo was 10,500 units. The CEO asked the accountant about the expected cost for the sales-order activity. A new software had been installed, and the...
-
Assume you purchased 500 shares of CBA stock on margin at $40 per share from your broker, If the initial margin is 60%, Calculate the amount you borrowed from the broker.
-
Find the first three terms of the sequence, Classify the sequence as arithmetic (give d value ), geometric (give r value), both, or neither..... Sn = 10n
-
In each case, sketch the set of points determined by the given conditions: (c) Im (z-i) = 2; (a) |2z+4-3i| 4; (b) |z+ 3i|+|z3i| = 10;
-
Wireless Tools, Inc., Inc is a calendar year, accrual basis corporation (book and tax). The company has total assets of $5,000,125. The company reported $390,000 in net income after federal income...
-
Rustafson Corporation is a diversified manufacturer of consumer goods. The company's act the following seven activity cost pools: Activity Cost Pool Labor-related Estimated Overhead Cost $ 17,200...
-
A market research survey in which 60 consumers were contacted states that 65% of all consumers of a certain product were motivated by the products advertising. Find the confidence limits for the...
-
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?
-
Find the free-vibration response of the spring-mass system shown in Fig. 6.6 (a) for \(k_{1}=k, k_{2}=2 k, k_{3}=3 k, m_{1}=m, m_{2}=2 m\), and \(m_{3}=3 m\) corresponding to the initial conditions...
-
Find the free-vibration response of the tightly stretched string shown in Fig. 6.33 for \(m_{1}=2 m, m_{2}=m, m_{3}=3 m\), and \(l_{i}=l(i=1,2,3,4)\). Assume the initial conditions as...
-
Find the free-vibration response of the triple pendulum shown in Fig. 6.10 for \(l_{i}=l(i=1,2,3)\) and \(m_{i}=m(i=1,2,3)\) for the initial conditions \(\theta_{1}(0)=\theta_{2}(0)=0\),...
Study smarter with the SolutionInn App