分类: LINUX
2010-06-29 10:37:11
-c | 仅通过编译。 bc命令的输出被发送到标准输出。 |
-l | 定义数学函数并且初始化值为20,取代默认值0。 |
filename | 文件名,它包含用于计算的计算器命令,这不是必须的命令。 |
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'. 9*2 18
上述命令是来做数学运算。
bc -l输出:
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'. 1+2 3
上述命令是求'1+2'的和。
bc calc.txt输出:
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'. 3
'calc.txt' 这个文件有代码:1+2。 从文件输入并且显示输出结果。
[root@linux ~]# bc |
[root@linux ~]# bc |
[root@linux ~]# bc |