At times when there's no good calculator within the reach of your hand and you are in dying need to multiply two numbers or do some other simply math operation (2*2?), I suggest you use perl one-liner to do the job. Just include this line in your .tcshrc or .cshrc (or any other such file):
alias calc perl -e \'print \"Simple Calculator\\n\\nResult: \" . \(\!\
+*\) .\"\\n\\n\"\;\'
(*note: you might have to prepend a full path to the 'perl' command.. something like '/usr/local/bin/perl' instead of
simply 'perl')
To use it, just type 'calc (some mathematical expression)' in your shell prompt.
Example:
> calc 5*5
Will print this:
Simple Calculator
Result: 25
Of course, you could use 'calc' to compute any other valid math expression.
;-)
|
"There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith
|