Link to home
Start Free TrialLog in
Avatar of jurij
jurij

asked on

bash programming - displaying (real) numbers

Hello!
I'm having problems with bash programming - when i try to do something like:
a=3
b=5
echo div: $(($a/$b))
I get 'div: 0'.
How can i display decimals?
|bc -l? how?

TNX
ASKER CERTIFIED SOLUTION
Avatar of MikeOM_DBA
MikeOM_DBA
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jimbb
jimbb

a=3
b=5
decimal_places=3

echo "scale=$decimal_places; $a/$b" | bc