Question: Linux. Write a script that will act as a simple calculator for add, subtract, multiply, and divide; each operations should be in a function of
Linux.
Write a script that will act as a simple calculator for add, subtract, multiply, and divide; each operations should be in a function of its own. Any of the three methods for bash arithmetic, let, expr or $((..)), may be used. The user should pass as an argument on the command line a letter (a, s, m or d) and two numbers. The letter will be used to determine which operation will be performed on the two numbers entered. If one or more of the three parameters is left out, then display a usage message. Finally display the answers. This script should be called calculator.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
