Code:
#!/bin/bash
# bash calculator
echo $1 | bc
exit
or really short
----------------------------
Code:
#!/bin/bash
echo "scale=4; $1" | bc ;exit
save as bashcalc.sh then put an alias into your .bashrc file
Code:
alias calc='sh /home/crouse/scripts/bashcalc.sh'
Quote:
crouse@linux:~> calc 3.555+7.999
11.554
crouse@linux:~>
|
The "scale=4" allows for division to be carried out to 4 decimal places. You can edit this to whatever length you wish to carry the division to.