Archive for November, 2009

Command Line Calculator for csh (C Shell)
November 3, 2009

Just add
alias calc ‘awk “BEGIN{ print \!:1 }”;’
to your .alias or whatever-your-default-shell-file-is file.
Restart the terminal.
Example usage:

calc 4*4

Though, it gets a bit cluttery if you want to use parenthesis.

calc “1000000\*\(1.45\+6.2\)\/100″

You need to put the whole expression in double quotes and use the escape character “\” for every symbol (*,/,),(,+,-) you use in the expression.
But [...]