calc () {
bc -l <<< "$@"
}
Example usage:
$ calc 65320/670
97.49253731343283582089
$ calc 65320*670
43764400
You can change this to suit yourself. For example:
divide() {
bc -l <<< "$1/$2"
}
Note: <<<
is a here string which is fed into the stdin of bc
. You don't need to invoke echo
.