A calculator at the command line

Like the Firefox Browser at least one Gnome Terminal window is always open on my desktop. So it’s very convenient to have a command line math calculator.

“bc” (bc – An arbitrary precision calculator language) is a real language to do calculations. But you can also use it to do simple and practical things at the command line:

luigi@luigi-laptop:~$ bc
bc 1.06.94
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
32*3
96
quit
luigi@luigi-laptop:~$

Also the bash has an integrated feature to evaluate simple math operations:

luigi@luigi-laptop:~$ echo $((32*3))
96
luigi@luigi-laptop:~$ 

I know, both the systems are quite difficult to remember, but you can create a script to have a command easy to recall.


No Responses to “A calculator at the command line”  

  1. No Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



Calendar

June 2008
M T W T F S S
« May   Jul »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:

Archives


Categories

Tag Cloud


Listening