Question: Write a script in Korn shell that presents a user with a menu as follows: Add the numbers (enter a or A) Subtract the numbers

Write a script in Korn 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

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!