Calculating with bc
UNIX even offers a handy calculator utility that lets you…er, um…calculate things. Just use bc, as shown in Code Listing 15.3.
To calculate with bc:
1. | bc |
2. | 6*5 |
3. |
Quit bc when you're done.
|
Tip
You can tell bc to calculate expressions within a file with bcbcfile. (Of course, replace bcfile with the real file name.) Then, bc waits for more ...
Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.