Find the answer to your Linux question:
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.
  1. #1
    Just Joined!
    Join Date
    Feb 2006
    Posts
    19

    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?

  2. #2
    Just Joined!
    Join Date
    Mar 2006
    Posts
    34
    Try:
    Code:
    #!/bin/bash
    echo $1 | bc
    See bc(1) for details.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •