The Geeky Command Prompt Calculator

image

Ever wish you could just do simple calculations from the terminal? All you need to do is add the following to your bashrc file (or run it from the terminal to test):

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

When you’re using it, just make sure to not add any spaces, or enclose the calculation parameters in quotes, like this:

calc "8 * 99 / 4"

command line calculator

Click here to view the comments (2)



Copyright © 2014 TinyHacker