Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Search sites via Google and Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Search sites via Google and Terminal
Authored by: pamon on Jun 06, '07 12:44:17PM
Thanks to rwmitchell here is updated version of all the codes. I have also changed the macosxhints.com part quite a bit. Google
#!/bin/sh

read F1
F=`echo $F1 | sed s/\ /+/g | sed 's/"/%22/g'`

open "http://google.com/search?q=$F"

Webster
#!/bin/sh

read F1
F=`echo $F1 | sed 's/\ /+/g' | sed 's/"/%22/g'`
open "http://google.com/search?q=%20site:merriam-webster.com%20$F"

Wikipedia
#!/bin/sh

read F1
F=`echo $F1 | sed 's/\ /+/g' | sed 's/"/%22/g'`

open "http://google.com/custom?hl=en&cof=&domains=en.wikipedia.org&btnG=Search&sitesearch=en.wikipedia.org&fulltext&q=$F"

macosxhints.com
#!/bin/sh

read F1
F=`echo $F1 | sed s/\ /+/g | sed 's/"/%22/g'`

open "http://google.com/custom?hl=en&cof=&domains=www.macosxhints.com&btnG=Search&sitesearch=www.macosxhints.com&q=$F"

man pages on apple.com
#!/bin/sh

read F1
F=`echo $F1 | sed 's/\ /+/g' | sed 's/"/%22/g'`

open http://google.com/search?q=%20site:apple.com%20manual+page+for+$F

apple's developer's website
#!/bin/sh

read F1
F=`echo $F1 | sed 's/\ /+/g' | sed 's/"/%22/g'`

open "http://developer.apple.com/cgi-bin/search.pl?q=$F&num=10&site=default_collection"

apple's support page:
#!/bin/sh

read F1
F=`echo $F1 | sed 's/\ /+/g' | sed 's/"/%22/g'`

open "http://search.info.apple.com/?q=$F&type=&search=Search&lr=lang_en&search=Go"

Google Maps:
#!/bin/sh

echo "where to?"
read F1
F=`echo $F1 | sed 's/\ /+/g' | sed 's/"/%22/g'`

open "http://maps.google.com/maps?f=q&hl=en&q=$F"


[ Reply to This | # ]
Search sites via Google and Terminal
Authored by: pwharff on Jun 06, '07 01:07:30PM

It would be much easier to use special variables to accept options and arguments in combination with CASE to combine all these search engines into one script.



[ Reply to This | # ]