Tuesday, 24 November 2009

Command Line Calculator

Thanks to this blog post I now have an instant command line calculator, and so can you. Add this to your .bashrc file

calc(){ awk "BEGIN{ print $* }" ;}

Then just type in a calculation, for example

$ calc 10*5/2
$ 25

Nice.

No comments:

Post a Comment