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

At the shell prompt, type bc. You'll find yourself at a blank line, waiting for math to do.

2.
6*5

Enter the numbers, operators, expressions, or whatever you want to calculate. Use + to add, - to subtract, * to multiply, and / to divide. The answer appears on the next line (Code Listing 15.3).

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 to do from the command line.


Tip

Type man bc for more details about bc's capabilities.


Code Listing 15.3. Using the bc utility, you can calculate and calculate and calculate….
xmission> bc
6*5
30
xmission>

Table 15.1. ispell menu items
ItemDescription
Accept your spelling, but don't add it to the dictionary.
rReplace with a word that you'll specify (after you type r).
AAccept the word for the rest of the current session.
iInsert the word into your dictionary.
uInsert the word (as all lowercase) into your dictionary.
qQuit ispell, saving all changes.
xExit ispell without saving any changes.
0-nReplace highlighted word with a suggested word.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.163.13