Created
November 9, 2012 10:21
-
-
Save mattintosh4/4045012 to your computer and use it in GitHub Desktop.
Google search form terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------- | |
# Google search from terminal | |
# -------------------------------------- | |
ggr(){ | |
_gU="$(echo $* | sed -e 's/^-[a-z] //' -e 's/ /+/g')" | |
_gU="https://www.google.co.jp/#hl=ja&safe=off&output=search&sclient=psy-ab&q=${_gU}&oq=${_gU}" | |
case $1 in | |
-c) _gA="/Applications/Google Chrome.app";; | |
-f) _gA="/Applications/Firefox.app";; | |
-s) _gA="/Applications/Safari.app";; | |
esac | |
_gC='open ${_gU} ${_gA:+-a} ${_gA}' | |
eval ${_gC} && eval echo ${_gC} | |
unset _g{A,C,U} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment