Skip to content

Instantly share code, notes, and snippets.

@hackugyo
Last active November 26, 2015 04:44
Show Gist options
  • Select an option

  • Save hackugyo/076bbd722b5e8be3fa15 to your computer and use it in GitHub Desktop.

Select an option

Save hackugyo/076bbd722b5e8be3fa15 to your computer and use it in GitHub Desktop.
パイプもしくは引数でI'm feeling luckyする。.bashrcに書いてexec bash; /bin/bash --login してくれ
gsearch_d ()
{
( if [ -p /dev/stdin ]; then
a=$(cat -);
else
a=$@;
fi;
argv=("$a");
str="$(echo -n $argv | nkf -wMQ | sed 's/=$//g' | tr = % | tr -d "\n")";
open https://www.google.co.jp/search?btnI'&'q="$str" & exit )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment