首页 > Linux操作系统 > Linux操作系统 > AIX下的小计算器 bc
# vmstat
System configuration: lcpu=1 mem=1024MB ent=0.10
kthr memory page faults cpu
----- ----------- ------------------------ ------------ -----------------------
r b avm fre re pi po fr sr cy in sy cs us sy id wa pc ec
1 1 136360 24579 0 0 0 0 0 0 14 197 305 2 3 95 0 0.01 5.9
# bc
4*24579
98316
4*136360
545440
man中的解释
Examples
1 You can use the bc command as a calculator. Depending on whether you
set the scale variable and with what value, the system displays
fractional amounts. Entering:
bc
1/4
displays only 0. To set the scale variable and add a comment, enter:
scale = 1 /* Keep 1 decimal place */
1/4
The screen displays 0.2. Entering:
scale = 3 /* Keep 3 decimal places */
1/4
displays 0.250. Entering:
16+63/5
displays 28.600. Entering
(16+63)/5
displays 15.800. Entering
71/6
displays 11.833.
The bc command displays the value of each expression when you press
the Enter key, except for assignments.
When you enter the bc command expressions directly from the
keyboard, press the End-of-File (Ctrl-D) key sequence to end the bc
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-1017881/ ,如需转载,请注明出处,否则将追究法律责任。