$ bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'.然后输入运算,按回车会输出运算结果
2+5 7 3*4 12 7-2 5 2^3 8 6%5 1 3/4 0
scale=3 3/4 .750可以一次输入多个运算,按照分号;来分隔,按回车后一次返回。
2+5;3*4;3*100 7 12 300数值比较
3 > 4 0 3 > 2 1逻辑表达式
(3> 2) || (1 < 2) 1 (3> 2) && (1 > 2) 0
$ echo "3+4" | bc 7分号;分隔输入多个
Linux下的简单好用的计算器bc,布布扣,bubuko.com
原文地址:http://blog.csdn.net/yonggang7/article/details/37317571