The script uses PHP (http://www.php.net), better known as a web
programming and templating language, on the command line, passing
your calculation query to Google, scraping the returned results, and
dropping the answer into your virtual lap.
This hack assumes that you have PHP installed on your computer and it
lives in the /usr/bin directory. If PHP is
somewhere else on your system, you should alter the path on the first
line accordingly (e.g., #!/usr/local/bin/php4).
urlencode(join(' ', array_splice($argv, 1)))), $matches);
print str_replace('<font size=-2> </font>', ',',
Save the code to a file called calc in your path
(I keep such things in a bin in my home
directory) and make it available to run by typing chmod +x