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"







You could use “bc” as well and have use of more functions than awk understands, e.g.
calc(){ echo $* | bc -l ; }
$ calc “l(1.0585)”
0.05685281159278279480
When calc(){ awk “BEGIN{ print $* }” ;} is entered in my terminal all it does is launch the calculator in windows 7