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 in the end, it works! :)
Update 1:
Just add
alias calc ‘echo "\!:*" | bc -l’
to your .alias or whatever-your-default-shell-file-is file.
Restart the terminal.
Example usage:
- calc 4*4
- calc 1000000*(6.2+1.45)/100
- calc 4^4 ( calculation of powers also works using bc! )
I dont disagree with you…