Question
Write a script in Bourne shell that presents a user with a menu as follows: Add the numbers (enter a or A) Subtract the numbers
Write a script in Bourne shell that presents a user with a menu as follows:
Add the numbers (enter a or A)
Subtract the numbers (enter s or S)
Multiply the numbers (enter m or M)
Divide the numbers (enter d or D)
Exit (select e or E)
If the user enters any other character other than the ones mentioned, then print an error saying it is not a choice and ask the user to select again until the correct option is chosen.
Once the operation is done, ask the user if they want to do another operation on the same two integers or do another operation with two different integers or exit. Do accordingly based on the users choice. So until the user does not select the exit option, the user is presented with a menu. Also, when you run the script, provide two integers as command line arguments. The beginning of your script should have an if statement that checks how many arguments are coming in and present a few statements about Usage of the script if the number of arguments is not 2.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started