Skip to content

Instantly share code, notes, and snippets.

Created December 22, 2013 07:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8079281 to your computer and use it in GitHub Desktop.
Save anonymous/8079281 to your computer and use it in GitHub Desktop.
function google() {
local str opt
if [ $# != 0 ]; then # 引数が存在すれば
for i in $*; do
str="$str+$i"
done
str=`echo $str | sed 's/^\+//'` #先頭の「+」を削除
opt='search?num=50&hl=ja&ie=euc-jp&oe=euc-jp&lr=lang_ja'
opt="${opt}&q=${str}"
fi
/Applications/Chromium.app/Contents/MacOS/Chromium http://www.google.co.jp/$opt #引数がなければ $opt は空になる
}
alias ggl=google
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment