If you've not used Google Calculator before, it's brilliant. Just type, for example, "1TB in Bytes" into Google and bam! you have an answer
It is also capable of many other conversions, another example might be "100RMB in GBP" (how much is 100 Chinese yuan worth in Sterling)
The net result is my new gcalc script... it's a really nasty hack (
#!/bin/sh
q=`echo "$@" | sed 's/ /\+/g'`
curl -s -A foo "http://www.google.com/search?q=$q" | gawk -F "font size=\\\\+1><b>|</b><tr>
In case you're wondering about the final sed... I don't like the way Calculator groups numerics in groups of 3... it's a real pain when you want to copy/paste values quickly
1 comments: