Here is a script that allows you to Google your query by typing it into Terminal:
#!/bin/sh
read F1
F=`echo $F1 | sed s/\ /+/g`
open "http://google.com/search?q=$F"
Copy and paste that into a new blank document in vi, pico, emacs, etc., and save it somewhere on your user's path. Then make it executable (chmod a+x googleit) and you can run it by typing googleit (or whatever you called it), pressing Return, and then entering your search term(s). You can't do a phrase search with this one -- try something quoted like "steve jobs and bill gates" and it will fail -- but I am hoping that someone here can come up with a solution.
Here is a good example which looks up word(s) in Webster via Google:
#!/bin/sh
echo "type your word(s) to look up"
read F1
F=`echo $F1 | sed s/\ /+/g`
open "http://google.com/search?q=%20site:merriam-webster.com%20$F"#!/bin/sh
echo "type the query that you want to know about?"
read F1
F=`echo $F1 | sed s/\ /+/g`
open "http://www.google.com/search?as_sitesearch=en.wikipedia.org&fulltext=Search&=Google&q=$F"#!/bin/sh
read F1
F=`echo $F1 | sed s/\ /+/g`
open http://google.com/search?q=%20site:macosxhints.com%20$F#!/bin/sh
read F1
F=`echo $F1 | sed s/\ /+/g`
open http://google.com/search?q=%20site:apple.com%20manual+page+for+$F#!/bin/sh
read F1
F=`echo $F1 | sed s/\ /+/g`
open "http://developer.apple.com/cgi-bin/search.pl?q=$F&num=10&site=default_collection"#!/bin/sh
read F1
F=`echo $F1 | sed s/\ /+/g`
open "http://search.info.apple.com/?q=$F&type=&search=Search&lr=lang_en&search=Go"#!/bin/sh
echo "where to?"
read F1
F=`echo $F1 | sed s/\ /+/g`
open "http://maps.google.com/maps?f=q&hl=en&q=$F"
Special thanks to James Reynolds for help with these scripts...
Mac OS X Hints
http://hints.macworld.com/article.php?story=2007060116541780