Results 1 to 2 of 2
hi, i am trying to program a calculator,
**************************************************
#!/bin/bash
echo "(($1))"
************************************************** *
.. and that is my whole program, works fine wth integers, but with decimals it would ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-16-2006 #1Just Joined!
- Join Date
- Feb 2006
- Posts
- 18
programming calculator with bash
hi, i am trying to program a calculator,
**************************************************
#!/bin/bash
echo "(($1))"
************************************************** *
.. and that is my whole program, works fine wth integers, but with decimals it would show error, can any help with calculating with decimals?
- 03-16-2006 #2Just Joined!
- Join Date
- Mar 2006
- Posts
- 34
Try:
See bc(1) for details.Code:#!/bin/bash echo $1 | bc


Reply With Quote
