Skip to content

Instantly share code, notes, and snippets.

@febeling
Created February 17, 2009 21:08
Show Gist options
  • Save febeling/65974 to your computer and use it in GitHub Desktop.
Save febeling/65974 to your computer and use it in GitHub Desktop.
Google from the shell for Mac OS X
#!/bin/sh
# -*- shell-script -*-
query=""
for term in $@
do
if [[ $query ]] ; then
query+="+$term"
else
query=$term
fi
done
if [[ $query ]] ; then
open "http://www.google.com/search?q=$query"
else
open "http://www.google.com/"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment