Calculator script

Rpl811

New Member
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:
[[email protected] chap7]# ./calc-hagan.sh add 3 2

3 + 2 = 5
 


JasKinasis

Well-Known Member
Credits
5,160
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:
[[email protected] 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


Latest posts

Top