Calculator script

Rpl811

New Member
Joined
Oct 11, 2020
Messages
1
Reaction score
0
Credits
13
Need help to write a calculator script using if and elif statements called “calc-yourlastname.sh” that will add (add), subtract (sub), multiply (mul) and integer divide (div) two numbers. The script should take 3 arguments from the command line and produce the output.


results should appear like:
[root@localhost chap7]# ./calc-hagan.sh add 3 2

3 + 2 = 5
 


Need help to write a calculator script using if and elif statements called “calc-yourlastname.sh” that will add (add), subtract (sub), multiply (mul) and integer divide (div) two numbers. The script should take 3 arguments from the command line and produce the output.


results should appear like:
[root@localhost chap7]# ./calc-hagan.sh add 3 2

3 + 2 = 5


Ok, this sounds like a homework question. So what have you got so far?
What specific part of this are you stuck on?

Show me the code you’ve got so far and tell me which parts you’re having problems with and I can help. But I’m not going to do your homework for you.
 

Members online


Top