This two line PHP script lets you use the Google calculator from your command line.
urlencode(join(' ', array_splice($argv, 1)))), $matches);
print str_replace('<font size=-2> </font>', ',',
To install, save it in a file in a directory in your PATH and run "chmod +x" to make it executable. It's invoked like this:
% calc 21 * 2
% calc 26 ounces + 1 pint in ounces
42 US fluid ounces
% calc answer to life, the universe and everything
If your shell gives you a parse error, place the calculation inside quotation marks.
There's absolutely no error checking in this Hack, so if you enter something that Google doesn't think is a calculation, then you'll likely get a PHP Notice. Likewise, if Google changes its HTML output, the regex could fail. But if this was more robust, it'd no longer be a hack.