(Solved) : 1 Write Script Bourne Shell Presents User Menu Follows Add Numbers Enter Subtract Numbers Q30154180 . . .
1. Write a script in Bourne shell that presents a user with amenu 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 onesmentioned, then print an error saying it is not a choice and askthe user to select again until the correct option is chosen.
Once the operation is done, ask the user if they want to doanother operation on the same two integers or do another operationwith two different integers or exit. Do accordingly based on theusers 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 ofyour script should have an if statement that checks how manyarguments are coming in and present a few statements about Usage ofthe script if the number of arguments is not 2.
2. Write a script in Bourne shell that asks the user for aninteger between 1 and 10 and prints out sum of integers from 1through the number entered and also the product of the integersfrom 1 through the number entered (which is also called thefactorial).
So for example, if the user enters 4, then the script shouldprint the sum as 10 (1+2+3+4) and 24 (1*2*3*4).
Expert Answer
Answer to 1 Write Script Bourne Shell Presents User Menu Follows Add Numbers Enter Subtract Numbers Q30154180 . . .
OR